Truncate title to 256 characters

This commit is contained in:
ekzyis 2022-04-15 01:01:55 +02:00
parent d2d1356521
commit bbbb39bf3d
1 changed files with 9 additions and 1 deletions

View File

@ -2,7 +2,15 @@ import discord
class BotMessage(discord.Embed): class BotMessage(discord.Embed):
pass def __init__(self, **kwargs):
title = kwargs.pop("title", None)[:256]
if title is not None:
# Max embed title length is 256
title = title[:256]
super().__init__(
**kwargs,
title=title
)
class ErrorMessage(BotMessage): class ErrorMessage(BotMessage):