hmm
This commit is contained in:
parent
b13eca9def
commit
397535f1e5
@ -286,15 +286,15 @@ class Client:
|
|||||||
@embed_color.setter
|
@embed_color.setter
|
||||||
def embed_color(self, value):
|
def embed_color(self, value):
|
||||||
if isinstance(value, (Color, Colour)):
|
if isinstance(value, (Color, Colour)):
|
||||||
self._embed_color = str(value)
|
self._embed_color = str(hex(value))
|
||||||
os.environ['DEFAULT_EMBED_COLOR'] = str(value)
|
os.environ['DEFAULT_EMBED_COLOR'] = str(hex(value))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
HEX = re.compile(r'^(#)[A-Fa-f0-9]{6}$')
|
HEX = re.compile(r'^(#)[A-Fa-f0-9]{6}$')
|
||||||
col = str(Color(value))
|
col = Color(value)
|
||||||
if HEX.match(col):
|
if HEX.match(str(col)):
|
||||||
self._embed_color = col
|
self._embed_color = str(hex(col))
|
||||||
os.environ['DEFAULT_EMBED_COLOR'] = str(col)
|
os.environ['DEFAULT_EMBED_COLOR'] = str(hex(col))
|
||||||
except:
|
except:
|
||||||
raise TypeError('embed_color must be an instance of discord.Colour or a valid 0x****** hex value.')
|
raise TypeError('embed_color must be an instance of discord.Colour or a valid 0x****** hex value.')
|
||||||
|
|
||||||
|
@ -112,7 +112,6 @@ class Embed:
|
|||||||
default_colour = kwargs.get('color', EmptyEmbed)
|
default_colour = kwargs.get('color', EmptyEmbed)
|
||||||
colour = os.getenv("DEFAULT_EMBED_COLOR", default=default_colour)
|
colour = os.getenv("DEFAULT_EMBED_COLOR", default=default_colour)
|
||||||
if isinstance(colour, str):
|
if isinstance(colour, str):
|
||||||
colour = colour.replace('#', '0x')
|
|
||||||
colour = int(colour, 16)
|
colour = int(colour, 16)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user