Skip to content
This repository has been archived by the owner on May 13, 2019. It is now read-only.

rixx/asyncirc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asyncirc Build Status Code Climate

Asyncirc is an asyncio-based IRC framework for Python.

Installation

pip install asyncio-irc

And you're done!

You can also use setup.py to manually install from a git version.

Connecting

from asyncirc import irc

bot = irc.connect("chat.freenode.net", 6697, use_ssl=True)
bot.register("nickname", "ident", "realname", password="pass") # password optional

Subscribing to events

@bot.on("message")
def incoming_message(parsed, user, target, text):
    # parsed is an RFC1459Message object
    # user is a User object with nick, user, and host attributes
    # target is a string representing nick/channel the message was sent to
    # text is the text of the message
    bot.say(target, "{}: you said {}".format(user.nick, text))

Using plugins

import asyncirc.plugins.tracking # channel/user state tracking
import asyncirc.plugins.addressed # events that fire when the bot is addressed
import asyncirc.plugins.nickserv # events that fire on nickserv authentication responses

Writing code without a reference to the IRCProtocol object

Asyncirc uses the excellent Blinker library. That means that you can just run from blinker import signal and hook into asyncirc's events without needing a reference to the IRCProtocol object. This is especially useful in writing plugins; take a look at plugin code for examples.

About

asyncio-based IRC library for Python. FORK OF DELETED ORIGINAL!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.6%
  • Makefile 1.4%