mirror of
https://github.com/UiO-Gaming/mustafa.git
synced 2026-11-05 13:56:48 +01:00
attempt to use anilist color for embeds
This commit is contained in:
1 parent
74756ed354
commit
8a5ea00c66
1 file changed
+6
-1
+6
-1
@@ -32,7 +32,7 @@ class Anime(commands.Cog):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
color (str): The color string returned from the Anilist API
|
||||
color (str): The color string returned from the Anilist API. Either a color name or a hex code like #3db4f2
|
||||
|
||||
Returns
|
||||
----------
|
||||
@@ -48,6 +48,11 @@ class Anime(commands.Cog):
|
||||
"green": 0x4CCA51,
|
||||
"gray": 0x677B94,
|
||||
}
|
||||
if color and color.startswith("#"):
|
||||
try:
|
||||
return int(color[1:], 16)
|
||||
except ValueError:
|
||||
pass
|
||||
return colors.get(color, 0x677B94)
|
||||
|
||||
def convert_media_format(self, media_format: str) -> str:
|
||||
|
||||
Reference in new issue
Block a user