diff --git a/cogs/api/types.py b/cogs/api/types.py index f9555a6..0e5a35d 100644 --- a/cogs/api/types.py +++ b/cogs/api/types.py @@ -264,8 +264,14 @@ async def send_embed( loop = asyncio.get_event_loop() estimate = await loop.run_in_executor(None, self.get_picture_color) + colors = len(estimate) - 1 - color = discord.Color.from_rgb(estimate[0], estimate[1], estimate[2]) + if colors < 0: + color = color_main + else: + color = discord.Color.from_rgb( + estimate[0], estimate[min(1, colors)], estimate[min(2, colors)] + ) embed = discord.Embed( title=f"{self.name}'s Profile", @@ -755,4 +761,4 @@ def embed_string(self, items: List) -> Dict[str, str]: elif isinstance(items[0], Studio): return None else: - raise TypeError("invalid item type in items") \ No newline at end of file + raise TypeError("invalid item type in items") diff --git a/cogs/controller.py b/cogs/controller.py index 9492dc6..01fcfcc 100644 --- a/cogs/controller.py +++ b/cogs/controller.py @@ -1,5 +1,4 @@ # discord imports -from os import terminal_size import discord from discord.ext import commands import asyncio @@ -870,7 +869,9 @@ def check_author(cctx: ComponentContext): ), color=color_errr, ) - await button_ctx.edit_origin(content="An error occured!", embed=embed) + await button_ctx.edit_origin( + content="An error occured!", embed=embed + ) return user: Activity = await Activity.create( @@ -914,7 +915,11 @@ def check_author(cctx: ComponentContext): ) except: - await message.delete() + try: + await message.delete() + except discord.errors.NotFound: + pass + break return