From f5c7ac30f75b357438e1a3ce57e0d49f6e800777 Mon Sep 17 00:00:00 2001 From: float-trip Date: Mon, 10 Jul 2023 00:52:26 +0000 Subject: [PATCH] Cap the considered reply length at 500 chars. --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index da56a8e..f12fe4a 100644 --- a/bot.py +++ b/bot.py @@ -91,7 +91,7 @@ class Bot: candidates.append(reply) print("Accepting reply.") - reply = max(candidates, key=utils.reply_length) + reply = max(candidates, key=lambda r: min(utils.reply_length(r, 500))) self.client.reply(reply, comment)