Skip to content

Commit 573cb4a

Browse files
committed
Add more friendly error when corrected message is too long
1 parent 7a0d9b3 commit 573cb4a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

techsupport_bot/commands/correct.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ async def correct_command(
5555
updated_message = self.prepare_message(
5656
message_to_correct.content, to_replace, replacement
5757
)
58+
59+
if len(updated_message) > 4096:
60+
await auxiliary.send_deny_embed(
61+
message="The corrected message is too long to send", channel=ctx.channel
62+
)
63+
return
64+
5865
embed = auxiliary.generate_basic_embed(
5966
title="Correction!",
6067
description=f"{updated_message} :white_check_mark:",

0 commit comments

Comments
 (0)