[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:
palmtree5
2018-05-27 20:28:22 -08:00
committed by Kowlin
parent 07eb6bf88e
commit 971ccf9df4
6 changed files with 107 additions and 24 deletions

View File

@@ -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