diff --git a/bot.py b/bot.py index f12fe4a..4257cca 100644 --- a/bot.py +++ b/bot.py @@ -91,7 +91,8 @@ class Bot: candidates.append(reply) print("Accepting reply.") - reply = max(candidates, key=lambda r: min(utils.reply_length(r, 500))) + # Get the longest reply, but cap the considered length at 500 chars. + reply = max(candidates, key=lambda r: min(utils.reply_length(r), 500)) self.client.reply(reply, comment)