insert check to log errors for messages over 512 bytes (#29)

fixes #24
pull/36/head
Mal Hancock 2018-10-06 17:46:04 -07:00 committed by GitHub
parent 6cf5e4bacc
commit df7007efd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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':