From 397535f1e5f0be369c0c1123524eafb343139476 Mon Sep 17 00:00:00 2001 From: iDutchy Date: Thu, 1 Oct 2020 22:05:34 +0000 Subject: [PATCH] hmm --- discord/client.py | 12 ++++++------ discord/embeds.py | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/discord/client.py b/discord/client.py index ab4b121e..351f36ba 100644 --- a/discord/client.py +++ b/discord/client.py @@ -286,15 +286,15 @@ class Client: @embed_color.setter def embed_color(self, value): if isinstance(value, (Color, Colour)): - self._embed_color = str(value) - os.environ['DEFAULT_EMBED_COLOR'] = str(value) + self._embed_color = str(hex(value)) + os.environ['DEFAULT_EMBED_COLOR'] = str(hex(value)) else: try: HEX = re.compile(r'^(#)[A-Fa-f0-9]{6}$') - col = str(Color(value)) - if HEX.match(col): - self._embed_color = col - os.environ['DEFAULT_EMBED_COLOR'] = str(col) + col = Color(value) + if HEX.match(str(col)): + self._embed_color = str(hex(col)) + os.environ['DEFAULT_EMBED_COLOR'] = str(hex(col)) except: raise TypeError('embed_color must be an instance of discord.Colour or a valid 0x****** hex value.') diff --git a/discord/embeds.py b/discord/embeds.py index 5d4f3d57..ac502934 100644 --- a/discord/embeds.py +++ b/discord/embeds.py @@ -112,7 +112,6 @@ class Embed: default_colour = kwargs.get('color', EmptyEmbed) colour = os.getenv("DEFAULT_EMBED_COLOR", default=default_colour) if isinstance(colour, str): - colour = colour.replace('#', '0x') colour = int(colour, 16)