fix: added handling for if there's no role icon
This commit is contained in:
parent
c03ca6649b
commit
1bab406e7e
1 changed files with 8 additions and 5 deletions
13
info/info.py
13
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
|
||||
|
|
Loading…
Reference in a new issue