From 1bab406e7e8ed1f9599ecbc7581ef247e18f826a Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 8 Aug 2023 20:15:17 -0400 Subject: [PATCH] fix: added handling for if there's no role icon --- info/info.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/info/info.py b/info/info.py index ba1da86..dc700d0 100644 --- a/info/info.py +++ b/info/info.py @@ -507,11 +507,14 @@ class Info(commands.Cog): async def roleinfo(self, ctx, role: discord.Role, list_permissions: bool = False): """Gives information on a specific role. `list_permissions` is ignored if the role you're checking has the `Administrator` permission.""" - icon = role.display_icon - if isinstance(icon, discord.Asset): - icon_url = icon.url - elif isinstance(icon, str): - icon_url = await self.fetch_twemoji(unicode_emoji=icon) + try: + icon = role.display_icon + if isinstance(icon, discord.Asset): + icon_url = icon.url + elif isinstance(icon, str): + icon_url = await self.fetch_twemoji(unicode_emoji=icon) + except commands.CommandInvokeError: + icon_url = None permissions = role.permissions if role.color.value == 0: colorint = 10070709