fix (topgg): Reply hook logic for long messages.

This commit is contained in:
2022-01-24 06:57:37 +02:00
parent 18d6c977d7
commit 45d6fc9b54

View File

@@ -53,9 +53,11 @@ 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:
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 and len(args[0]) + len(upvote_info_formatted) < 1998:
elif args:
if len(args[0]) + len(upvote_info_formatted) < 1998:
args = list(args)
args[0] += '\n\n' + upvote_info_formatted
else: