mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 08:52:31 -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:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user