def notify(self, client, event): if event.command == 'PRIVMSG': response = self.expand_links(event.message) if response: if event.target.startswith('#'): client.send_message(event.target, response) else: client.send_message(event.source, response)
def notify(self, client, event): if event.command == 'PRIVMSG' and event.message.startswith('!ping'): response = '!pong' if response: if event.target.startswith('#'): client.send_message(event.target, response) else: client.send_message(event.source, response)
def notify(self, client, event): if event.command == 'PRIVMSG' and self.commandRE.search(event.message): command = self.commandRE.search(event.message).group(1) response = None if command == 'cake': response = self.cake(event.source, event.message) if response: if event.target.startswith('#'): client.send_message(event.target, response) else: client.send_message(event.source, response)