mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
[V3 Core] add support for setting a color for embeds (#1707)
* [V3 Core] add support for setting a color for embeds * Add a guild toggle for whether to use the bot color * Add a function for getting embed color in Context * Coroutines need to be awaited lol
This commit is contained in:
@@ -121,6 +121,20 @@ class Context(commands.Context):
|
||||
await query.delete()
|
||||
return ret
|
||||
|
||||
async def embed_colour(self):
|
||||
"""
|
||||
Helper function to get the colour for an embed.
|
||||
|
||||
Returns
|
||||
-------
|
||||
discord.Colour:
|
||||
The colour to be used
|
||||
"""
|
||||
if self.guild and await self.bot.db.guild(self.guild).use_bot_color():
|
||||
return self.guild.me.color
|
||||
else:
|
||||
return self.bot.color
|
||||
|
||||
async def embed_requested(self):
|
||||
"""
|
||||
Simple helper to call bot.embed_requested
|
||||
|
||||
Reference in New Issue
Block a user