Advertisement
OrFeAsGr

test

Apr 29th, 2023
900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import irc.client
  2.  
  3. def on_connect(connection, event):
  4.     print(event.arguments)
  5.     connection.join("#chaos")
  6.  
  7. def on_join(connection, event):
  8.     print(vars(event))
  9.  
  10. def on_disconnect(connectiom, event):
  11.     print(vars(event))
  12.  
  13. def startirc(server, port, nick):
  14.     #reactor = irc.client.Reactor()
  15.     s = irc.client.Reactor()
  16.     x = s.server()
  17.     c = x.connect(server, port, nick)
  18.     c.add_global_handler("welcome", on_connect)
  19.     c.add_global_handler("join", on_join)
  20.     c.add_global_handler("disconnect", on_disconnect)
  21.     s.process_forever()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement