Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 9b6a133f18
Fetching contributors…

Cannot retrieve contributors at this time

64 lines (42 sloc) 1.952 kB

ircutils.client

SimpleClient

Examples

Here is a simple script that works with the IRC client in order to print messages:

from ircutils import client


def message_printer(client, event):
    print "<{0}/{1}> {2}".format(event.source, event.target, event.message)

def notice_printer(client, event):
    print "(NOTICE) {0}".format(event.message)


# Create a SimpleClient instance
my_client = client.SimpleClient(nick="client_name")

# Add the event handlers
my_client["channel_message"].add_handler(message_printer)
my_client["notice"].add_handler(notice_printer)

# Finish setting up the client
my_client.connect("irc.freenode.com", channel="#ircutils")
my_client.start()
Jump to Line
Something went wrong with that request. Please try again.