mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-14 19:15:48 +02:00
Check escaped message length before mocking it
This commit is contained in:
parent
accda93461
commit
6c8ab9a2a0
1 changed files with 3 additions and 3 deletions
|
|
@ -150,13 +150,13 @@ class Fun(commands.Cog):
|
|||
if len(message) > constants.Limits.MESSAGE_LENGTH:
|
||||
return await interaction.followup.send("That message is too long.")
|
||||
|
||||
mocked_message = mock(discord.utils.escape_markdown(message))
|
||||
message = discord.utils.escape_markdown(message)
|
||||
|
||||
# Escaping md syntax can make the message longer than the limit
|
||||
if len(mocked_message) > constants.Limits.MESSAGE_LENGTH:
|
||||
if len(message) > constants.Limits.MESSAGE_LENGTH:
|
||||
return await interaction.followup.send("Because of Markdown syntax escaping, that message is too long.")
|
||||
|
||||
return await interaction.followup.send(mocked_message)
|
||||
return await interaction.followup.send(mock(message))
|
||||
|
||||
@commands.hybrid_command(name="xkcd")
|
||||
@app_commands.rename(comic_id="id")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue