This commit is contained in:
iDutchy 2020-10-01 22:11:25 +00:00
parent 397535f1e5
commit 291237bac9
2 changed files with 5 additions and 5 deletions

View File

@ -286,15 +286,15 @@ 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(hex(value))
self._embed_color = str(int(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(hex(col))
os.environ['DEFAULT_EMBED_COLOR'] = str(hex(col))
self._embed_color = str(int(col))
os.environ['DEFAULT_EMBED_COLOR'] = str(int(col))
except:
raise TypeError('embed_color must be an instance of discord.Colour or a valid 0x****** hex value.')

View File

@ -112,7 +112,7 @@ class Embed:
default_colour = kwargs.get('color', EmptyEmbed)
colour = os.getenv("DEFAULT_EMBED_COLOR", default=default_colour)
if isinstance(colour, str):
colour = int(colour, 16)
colour = int(colour)
self.colour = colour