From 45d6fc9b541ef1f9f6d0714f3facb60cf38ec4f1 Mon Sep 17 00:00:00 2001 From: Conatum Date: Mon, 24 Jan 2022 06:57:37 +0200 Subject: [PATCH] fix (topgg): Reply hook logic for long messages. --- bot/modules/topgg/module.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bot/modules/topgg/module.py b/bot/modules/topgg/module.py index 0ea5e532..a15cb36f 100644 --- a/bot/modules/topgg/module.py +++ b/bot/modules/topgg/module.py @@ -53,11 +53,13 @@ async def topgg_reply_wrapper(func, ctx: LionContext, *args, suggest_vote=True, ) else: # Add message to content - if 'content' in kwargs and kwargs['content'] and len(kwargs['content']) + len(upvote_info_formatted) < 1998: - kwargs['content'] += '\n\n' + upvote_info_formatted - elif args and len(args[0]) + len(upvote_info_formatted) < 1998: - args = list(args) - args[0] += '\n\n' + upvote_info_formatted + if 'content' in kwargs and kwargs['content']: + if len(kwargs['content']) + len(upvote_info_formatted) < 1998: + kwargs['content'] += '\n\n' + upvote_info_formatted + elif args: + if len(args[0]) + len(upvote_info_formatted) < 1998: + args = list(args) + args[0] += '\n\n' + upvote_info_formatted else: kwargs['content'] = upvote_info_formatted