Skip to main content

Relay is an irc micro-framework that smells too much like a web framework

Project description

An irc micro-framework that smells too much like a web framework.

Relay is a toy project, its goals were for me to try out framework design, learn more about the IRC protocol, and to be a replacement for the available irc python libraries: most of them did not please me.


I suggest you use a virtualenv

$ pip install relay-framework


This is an example of a bot that sends whatever is send after ‘!echo ‘ in a PRIVMSG:

from relay import Relay, auto_join, auto_pong
from relay.constants import privmsg

bot = Relay("echobot")

def echo(target, message, sender, *args, **kwargs):
    if not message.startswith("!echo "):
    sender_nick = sender.split('@')[0].split('!')[0] # We just want the nick
    message = message[6:] # We just want whatever is after '!echo '
    if target == bot.client['nick']:
        result = "PRIVMSG {sender_nick} :{sender_nick}: {message}"
        result = "PRIVMSG {{target}} :{sender_nick}: {message}"
    yield result.format(sender_nick=sender_nick, message=message)

if __name__ == "__main__":

And to run it:

$ RELAY_NICK=echobot python



Initial version, client accepts handlers, connects and matches data with those.


  • Write a decent IRC client implementation

  • Write tests for the Relay class

  • Write documentation

  • Subclass Relay to allow regexp routes

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

relay-framework-0.2.0.tar.gz (5.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page