import miniirc
# Not required, however this makes sure miniirc isn't outdated.
assert miniirc.ver >= (1,4,0)
@miniirc.Handler('PRIVMSG', 'NOTICE')
def handler(irc, hostmask, args):
print(hostmask[0], 'sent a message to', args[0], 'with content', args[1])
# nickname sent a message to #channel with content :Hello, world!
@miniirc.CmdHandler('PRIVMSG', 'NOTICE', colon = False)
def cmdhandler(irc, command, hostmask, args):
print(hostmask[0], 'sent a', command, 'to', args[0], 'with content',
args[1])
# nickname sent a PRIVMSG to #channel with content Hello, world!