From 8a5ea00c66a01cfffd1cb3bbb82b50ee2a70b1b3 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Sat, 24 Oct 2026 04:24:57 +0200 Subject: [PATCH] attempt to use anilist color for embeds --- src/cogs/anime.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cogs/anime.py b/src/cogs/anime.py index 17ea8d5..c2ed30e 100644 --- a/src/cogs/anime.py +++ b/src/cogs/anime.py @@ -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: