Fix leaver get_embed_color issue (#84)

* Fix embed color

* Gotta await it
pull/85/head
bobloy 5 years ago committed by GitHub
parent 41b2ce7391
commit a4a787830a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,7 +15,9 @@ class Leaver(Cog):
def __init__(self, bot: Red): def __init__(self, bot: Red):
self.bot = bot self.bot = bot
self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True) self.config = Config.get_conf(
self, identifier=9811198108111121, force_registration=True
)
default_guild = {"channel": ""} default_guild = {"channel": ""}
self.config.register_guild(**default_guild) self.config.register_guild(**default_guild)
@ -41,9 +43,15 @@ class Leaver(Cog):
if channel != "": if channel != "":
channel = guild.get_channel(channel) channel = guild.get_channel(channel)
out = "{}{} has left the server".format(member, member.nick if member.nick is not None else "") out = "{}{} has left the server".format(
member, member.nick if member.nick is not None else ""
)
if await self.bot.embed_requested(channel, member): if await self.bot.embed_requested(channel, member):
await channel.send(embed=discord.Embed(description=out, color=self.bot.color)) await channel.send(
embed=discord.Embed(
description=out, color=(await self.bot.get_embed_color(channel))
)
)
else: else:
await channel.send(out) await channel.send(out)
else: else:

Loading…
Cancel
Save