def handle(self, message): logger.info(message) target = message['metadata']['opts']['target'] for split_line in Utilities.tokenize(message['text']): for truncated_line in Utilities.truncate(split_line): self.botThread.connection.privmsg(target, truncated_line) # Delay to prevent floods time.sleep(0.25)
def handle(self, message): ''' Attempts to send a message to the specified destination in IRC Extends Legobot.Lego.handle() Args: message (Legobot.Message): message w/ metadata to send. ''' logger.debug(message) if Utilities.isNotEmpty(message['metadata']['opts']): target = message['metadata']['opts']['target'] for split_line in Utilities.tokenize(message['text']): for truncated_line in Utilities.truncate(split_line): self.botThread.connection.privmsg(target, truncated_line) # Delay to prevent floods time.sleep(0.25)