def action(self, user, channel, msg):
"""Called when the bot sees someone do an action."""
user = user.split('!', 1)[0]
self.logic.log(colorama.Fore.MAGENTA + "* " + user + colorama.Fore.WHITE + " " + msg)
if channel == self.nickname:
f = self.logic.check_update(self.logic.FIRST_TIME_MSG, user, "firsttime.txt")
u = self.logic.check_update(self.logic.UPDATE_MSG, user, "updates.txt")
if f:
self.msg(user, f)
if u:
self.msg(user, u)
d = threads.deferToThread(self.logic.sendpp, msg, user, "np")
d.addCallback(self.logCommand, user)
d.addErrback(log.err)
else:
pass
评论列表
文章目录