Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import irc.client
- def on_connect(connection, event):
- print(event.arguments)
- connection.join("#chaos")
- def on_join(connection, event):
- print(vars(event))
- def on_disconnect(connectiom, event):
- print(vars(event))
- def startirc(server, port, nick):
- #reactor = irc.client.Reactor()
- s = irc.client.Reactor()
- x = s.server()
- c = x.connect(server, port, nick)
- c.add_global_handler("welcome", on_connect)
- c.add_global_handler("join", on_join)
- c.add_global_handler("disconnect", on_disconnect)
- s.process_forever()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement