Fixed too long embed eror

This commit is contained in:
Paillat
2023-03-09 17:01:06 +01:00
parent 4c87c66add
commit 5b2133bd61

View File

@@ -25,6 +25,9 @@ class MyModal(discord.ui.Modal):
embed.add_field(name="Guild", value=self.message.guild.name, inline=True)
history = await self.message.channel.history(limit=5).flatten()
for msg in history:
if len(msg.content) > 1023:
embed.add_field(name="Message", value=msg.content[:1023], inline=False)
else:
embed.add_field(name="Message", value=msg.content, inline=False)
await webhook.send(embed=embed)
except Exception as e: