insert check to log errors for messages over 512 bytes

pull/29/head
Mal Hancock 2018-10-06 17:42:32 -07:00
parent b8aed568f4
commit 392d7a6dac
1 changed files with 3 additions and 1 deletions

View File

@ -220,7 +220,9 @@ class Bot(irc.bot.SingleServerIRCBot):
def process_output(self, c, chan, output):
for msg in output.msg:
if output.msg_type == 'message':
if len(msg.encode('UTF-8')) > 512:
self.logger.error('output message too long: {}'.format(msg))
elif output.msg_type == 'message':
self.logger.debug('output message: {}'.format(msg))
c.privmsg(chan, msg)
elif output.msg_type == 'action':