JustIRC

JustIRC is a single-file IRC library written in Python that allows you to write simple IRC bots and clients. It’s designed to be simple rather than feature-rich.

Main features

JustIRC is

Download

The self-contained nature of JustIRC makes it easy to install and deploy it on your projects. You can install the PyPI package using pip install JustIRC. Alternatively, you can download JustIRC.py and put it in the same directory as your project.

Documentation

The library is a single file with generous use of comments. There is also some documentation on here.

Getting started

import JustIRC

bot = JustIRC.IRCConnection()

@bot.on("connect")
def connect(e):
  bot.set_nick("TestBot")
  bot.send_user_packet("TestBot")

@bot.on("welcome")
def welcome(e):
  bot.join_channel("#HelloBotTest")

@bot.on("message")
def message(e):
  message = e.message.lower()
  if "hello" in message:
    message = f"Hello, {e.sender}"
    bot.send_message(e.channel, message)

bot.connect("irc.freenode.net")
bot.run_loop()

License

JustIRC is provided to you under the MIT License. The license text is provided below.

Copyright (c) 2015-2021  Gökberk Yaltıraklı

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Gokberk Yaltirakli - https://www.gkbrk.com/