Truncate title to 256 characters
This commit is contained in:
parent
d2d1356521
commit
bbbb39bf3d
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue