mirror of
https://github.com/wr34k/IRCUFC.git
synced 2024-11-26 01:16:38 +00:00
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import time
|
|
|
|
def eventPING(IRC, line):
|
|
IRC.raw("PONG {}".format(line[1]))
|
|
|
|
def event001(IRC, line):
|
|
IRC.join()
|
|
|
|
def event433(IRC, line):
|
|
IRC.nick += "_"
|
|
IRC.updateNick()
|
|
|
|
def eventJOIN(IRC, line):
|
|
IRC.log.info("{} JOIN to {}".format(line[0], line[2]))
|
|
|
|
def eventPART(IRC, line):
|
|
IRC.log.info("{} PART from {}".format(line[0], line[2]))
|
|
|
|
def eventKICK(IRC, line):
|
|
if line[3] == IRC.nick:
|
|
IRC.log.warn("Got kicked from {} !".format(line[2]))
|
|
chan = line[2]
|
|
if chan == IRC.channel:
|
|
IRC.join()
|
|
|
|
def eventQUIT(IRC, line):
|
|
if line[0][1:].split("@")[0].split("!")[0] == IRC.nick:
|
|
IRC.log.warn("quit ! Reconnecting in 15 seconds..")
|
|
time.sleep(15)
|
|
IRC.run()
|
|
|
|
def eventINVITE(IRC, line):
|
|
IRC.log.info("{} invited the bot to {}".format(line[0][1:].split("!")[0], line[3][1:]))
|
|
|
|
def eventPRIVMSG(IRC, line):
|
|
nick,user = line[0][1:].split("@")[0].split("!")
|
|
user = user[1:] if user[0] == '~' else user
|
|
host = line[0].split("@")[1]
|
|
IRC.handle_msg(line[2], IRC.isAdmin(line[0][1:]), nick, user, host, ' '.join(line[3:])[1:])
|