Skip to main content

asyncio-based rfc2812-compliant IRC Client

Project description

asyncio-based rfc2812-compliant IRC Client (3.5+)

bottom isn’t a kitchen-sink library. Instead, it provides a consistent API with a small surface area, tuned for performance and ease of extension. Similar to the routing style of, hooking into events is one line.


pip install bottom

Getting Started

(the full documentation is available here:

Create an instance:

import asyncio
import bottom

host = ''
port = 6697
ssl = True

NICK = "bottom-bot"
CHANNEL = "#bottom-dev"

bot = bottom.Client(host=host, port=port, ssl=ssl)

Send nick/user/join when connection is established:

async def connect(**kwargs):
    bot.send('NICK', nick=NICK)
    bot.send('USER', user=NICK,

    # Don't try to join channels until the server has
    # sent the MOTD, or signaled that there's no MOTD.
    done, pending = await asyncio.wait(

    # Cancel whichever waiter's event didn't come in.
    for future in pending:

    bot.send('JOIN', channel=CHANNEL)

Respond to ping:

def keepalive(message, **kwargs):
    bot.send('PONG', message=message)

Echo messages (channel and direct):

def message(nick, target, message, **kwargs):
    """ Echo all messages """
    # don't echo self
    if nick == NICK: return
    # respond directly
    if target == NICK: target = nick
    bot.send("PRIVMSG", target=target, message=message)

Connect and run the bot forever:



The full API consists of 1 class, with 8 methods:

# manage connections

async Client.connect()
async Client.disconnect()

# send, receive, and wait for rfc-2812 messages

Client.send(command, **kwargs)
Client.trigger(event, **kwargs)
async Client.wait(event)

# send and receive anything newline-terminated,
# provided for eg. IRCv3 extensions


Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
bottom-2.1.3-py2.py3-none-any.whl (15.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3
bottom-2.1.3.tar.gz (13.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page