From b8c83de838d507feffe12bb7019be4dc2688185d Mon Sep 17 00:00:00 2001 From: FrozenChen Date: Wed, 29 May 2024 13:46:44 -0300 Subject: [PATCH] unidb: Add fallback if there is no color --- cogs/assistance.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cogs/assistance.py b/cogs/assistance.py index dffc8b90..607cb2d6 100644 --- a/cogs/assistance.py +++ b/cogs/assistance.py @@ -3,6 +3,7 @@ import asyncio import discord import logging +import time from discord.ext import commands from os.path import dirname, join @@ -10,7 +11,7 @@ from utils.checks import check_if_user_can_sr, is_staff, soap_check from utils.mdcmd import add_md_files_as_commands from utils.views import BasePaginator, PaginatedEmbedView -from utils.utils import KurisuCooldown +from utils.utils import KurisuCooldown, gen_color if TYPE_CHECKING: from kurisu import Kurisu @@ -33,7 +34,8 @@ def current(self): return embed def create_embed(self, app: dict): - embed = discord.Embed(color=int(app['color'][1:], 16)) + color = int(app['color'][1:], 16) if app.get('color') else gen_color(time.time()) + embed = discord.Embed(color=color) embed.title = app['title'] embed.description = f"{app.get('description', 'No description provided.')}\n" if 'download_page' in app: