From 8eef448ca3f7b15ce2972c4e10716d227ce9be87 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 8 Aug 2023 16:42:17 -0400 Subject: [PATCH] feat: added role icons to roleinfo --- info/info.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/info/info.py b/info/info.py index 281af7e..fc4d924 100644 --- a/info/info.py +++ b/info/info.py @@ -500,6 +500,11 @@ 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 + else: + icon_url = None permissions = role.permissions if role.color.value == 0: colorint = 10070709 @@ -510,6 +515,8 @@ class Info(commands.Cog): colorcodelink = f"https://www.color-hex.com/color/{color}" timestamp = int(datetime.timestamp(role.created_at)) embed = discord.Embed(title=f"{role.name}", color=colorint, description=f"**ID:** {role.id}\n**Mention:** {role.mention}\n**Creation Date:** \n**Color:** [#{color}]({colorcodelink})\n**Hoisted:** {role.hoist}\n**Position:** {role.position}\n**Managed:** {role.managed}\n**Mentionable:** {role.mentionable}\n**Administrator:** {permissions.administrator}") + if icon_url: + embed.set_thumbnail(icon_url) if permissions.administrator == False and list_permissions == True: embed.add_field(name="Permissions", value=f"**Manage Server:** {permissions.manage_guild}\n**Manage Webhooks:** {permissions.manage_webhooks}\n**Manage Channels:** {permissions.manage_channels}\n**Manage Roles:** {permissions.manage_roles}\n**Manage Emojis:** {permissions.manage_emojis}\n**Manage Messages:** {permissions.manage_messages}\n**Manage Nicknames:** {permissions.manage_nicknames}\n**Mention @everyone**: {permissions.mention_everyone}\n**Ban Members:** {permissions.ban_members}\n**Kick Members:** {permissions.kick_members}") await ctx.send(embed=embed)