Skip to content

Commit

Permalink
unidb: Add fallback if there is no color
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenChen committed May 29, 2024
1 parent 94355ae commit b8c83de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cogs/assistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import asyncio
import discord
import logging
import time

from discord.ext import commands
from os.path import dirname, join
from typing import Optional, Literal, TYPE_CHECKING
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
Expand All @@ -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:
Expand Down

0 comments on commit b8c83de

Please sign in to comment.