mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Raise on an uncompliant message in Context.maybe_send_embed() (#4465)
* Raise on uncompliant message * just wait for me to be done flame! (grammar+testing) * i liked this better
This commit is contained in:
parent
34b912bc7c
commit
0fb7c8bdba
@ -248,8 +248,11 @@ class Context(DPYContext):
|
||||
see `discord.abc.Messageable.send`
|
||||
discord.HTTPException
|
||||
see `discord.abc.Messageable.send`
|
||||
ValueError
|
||||
when the message's length is not between 1 and 2000 characters.
|
||||
"""
|
||||
|
||||
if not message or len(message) > 2000:
|
||||
raise ValueError("Message length must be between 1 and 2000")
|
||||
if await self.embed_requested():
|
||||
return await self.send(
|
||||
embed=discord.Embed(description=message, color=(await self.embed_colour()))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user