From 768f409a8445a04064e45c787d6b144ef501c31e Mon Sep 17 00:00:00 2001 From: iDutchy Date: Thu, 1 Oct 2020 22:22:53 +0000 Subject: [PATCH] hmm --- discord/client.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/discord/client.py b/discord/client.py index 954a24ba..6a257970 100644 --- a/discord/client.py +++ b/discord/client.py @@ -235,7 +235,19 @@ class Client: self._listeners = {} self.shard_id = options.get('shard_id') self.shard_count = options.get('shard_count') - self._embed_color = options.get('embed_color') + colour = options.get('embed_color') + if isinstance(colour, (Color, Colour)): + self.embed_color = str(hex(colour)) + os.environ['DEFAULT_EMBED_COLOR'] = str(hex(colour)) + else: + try: + HEX = re.compile(r'^(#)[A-Fa-f0-9]{6}$') + col = Color(colour) + 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.') connector = options.pop('connector', None) proxy = options.pop('proxy', None) @@ -285,18 +297,7 @@ class Client: @embed_color.setter def embed_color(self, value): - if isinstance(value, (Color, Colour)): - self._embed_color = str(hex(value)) - os.environ['DEFAULT_EMBED_COLOR'] = str(int(value)) - else: - try: - HEX = re.compile(r'^(#)[A-Fa-f0-9]{6}$') - col = Color(value) - if HEX.match(str(col)): - self._embed_color = str(int(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.') + @property def latency(self):