@commands.command()
async def roleinfo(self, ctx, *, role_: discord.Role=None):
    role = role_
    if (role is None):
        (await ctx.send('Please provide a valid role'))
    em = discord.Embed(title=f'Info about {role.name}', color=ctx.author.color, description=f'Here is an insight into {role.mention}')
    em.add_field(name='ID:', value=f'`{role.id}`')
    em.add_field(name='Name:', value=f'`{role.name}`')
    em.add_field(name='Server it belongs to:', value=f'{role.guild.name}', inline=True)
    em.add_field(name='Hoisted:', value=f'`{role.hoist}`')
    em.add_field(name='Managed by extension:', value=f'`{role.managed}`', inline=True)
    em.add_field(name='Boost Role:', value=f'`{role.is_premium_subscriber()}`', inline=True)
    em.add_field(name='Mentionable:', value=f'`{role.mentionable}`')
    em.add_field(name='Is Default:', value=f'`{role.is_default()}`', inline=True)
    em.add_field(name='Bot Role:', value=f'`{role.is_bot_managed()}`', inline=True)
    em.add_field(name='Color:', value=f'{role.color}')
    em.add_field(name='Created At:', value=f'{role.created_at}', inline=True)
    em.add_field(name='People with it:', value=f'{len(role.members)}', inline=True)
    msg = '```diff\n'
    if role.permissions.administrator:
        msg += '+ Administrator\n'
    else:
        msg += '- Administrator\n'
    if role.permissions.manage_guild:
        msg += '+ Manage Server\n'
    else:
        msg += '- Manage Server\n'
    if role.permissions.mention_everyone:
        msg += '+ Ping Everyone\n'
    else:
        msg += '- Ping Everyone\n'
    if role.permissions.manage_roles:
        msg += '+ Manage Roles\n'
    else:
        msg += '- Manage Roles\n'
    if role.permissions.manage_channels:
        msg += '+ Manage Channels\n'
    else:
        msg += '- Manage Channels\n'
    if role.permissions.ban_members:
        msg += '+ Ban Members\n'
    else:
        msg += '- Ban Members\n'
    if role.permissions.kick_members:
        msg += '+ Kick Members\n'
    else:
        msg += '- Kick Members\n'
    if role.permissions.view_audit_log:
        msg += '+ View Audit Log\n'
    else:
        msg += '- View Audit Log\n'
    if role.permissions.manage_messages:
        msg += '+ Manage Messages\n'
    else:
        msg += '- Manage Messages\n'
    if role.permissions.add_reactions:
        msg += '+ Add Reactions\n'
    else:
        msg += '- Add Reactions\n'
    if role.permissions.view_channel:
        msg += '+ Read Messages\n'
    else:
        msg += '- Read Messages\n'
    if role.permissions.send_messages:
        msg += '+ Send Messages\n'
    else:
        msg += '- Send Messages\n'
    if role.permissions.embed_links:
        msg += '+ Embed Links\n'
    else:
        msg += '- Embed Links\n'
    if role.permissions.read_message_history:
        msg += '+ Read Message History\n'
    else:
        msg += '- Read Message History\n'
    if role.permissions.view_guild_insights:
        msg += '+ View Guild Insights\n'
    else:
        msg += '- View Guild Insights\n'
    if role.permissions.connect:
        msg += '+ Join VC\n'
    else:
        msg += '- Join VC\n'
    if role.permissions.speak:
        msg += '+ Speak in VC\n'
    else:
        msg += '- Speak in VC\n'
    if role.permissions.change_nickname:
        msg += '+ Change Nickname\n'
    else:
        msg += '- Change Nickname\n'
    if role.permissions.manage_nicknames:
        msg += '+ Manage Nicknames\n'
    else:
        msg += '- Manage Nicknames\n'
    if role.permissions.manage_webhooks:
        msg += '+ Manage Webhooks\n'
    else:
        msg += '- Manage Webhooks\n'
    if role.permissions.manage_emojis:
        msg += '+ Manage Emojis\n'
    else:
        msg += '- Manage Emojis\n'
    msg += '\n```'
    em.add_field(name='Permissions:', value=msg, inline=False)
    em.set_footer(text='invite me ;)', icon_url=ctx.author.avatar_url)
    em.set_thumbnail(url=str(ctx.guild.icon_url))
    em.set_author(name=ctx.author.name, icon_url=ctx.author.avatar_url)
    (await ctx.send(embed=em))
@commands.command()
async def roleinfo(self, ctx, *, role_: discord.Role=None):
    role = role_
    if (role is None):
        (await ctx.send('Please provide a valid role'))
    em = discord.Embed(title=f'Info about {role.name}', color=ctx.author.color, description=f'Here is an insight into {role.mention}')
    em.add_field(name='ID:', value=f'`{role.id}`')
    em.add_field(name='Name:', value=f'`{role.name}`')
    em.add_field(name='Server it belongs to:', value=f'{role.guild.name}', inline=True)
    em.add_field(name='Hoisted:', value=f'`{role.hoist}`')
    em.add_field(name='Managed by extension:', value=f'`{role.managed}`', inline=True)
    em.add_field(name='Boost Role:', value=f'`{role.is_premium_subscriber()}`', inline=True)
    em.add_field(name='Mentionable:', value=f'`{role.mentionable}`')
    em.add_field(name='Is Default:', value=f'`{role.is_default()}`', inline=True)
    em.add_field(name='Bot Role:', value=f'`{role.is_bot_managed()}`', inline=True)
    em.add_field(name='Color:', value=f'{role.color}')
    em.add_field(name='Created At:', value=f'{role.created_at}', inline=True)
    em.add_field(name='People with it:', value=f'{len(role.members)}', inline=True)
    msg = '```diff\n'
    if role.permissions.administrator:
        msg += '+ Administrator\n'
    else:
        msg += '- Administrator\n'
    if role.permissions.manage_guild:
        msg += '+ Manage Server\n'
    else:
        msg += '- Manage Server\n'
    if role.permissions.mention_everyone:
        msg += '+ Ping Everyone\n'
    else:
        msg += '- Ping Everyone\n'
    if role.permissions.manage_roles:
        msg += '+ Manage Roles\n'
    else:
        msg += '- Manage Roles\n'
    if role.permissions.manage_channels:
        msg += '+ Manage Channels\n'
    else:
        msg += '- Manage Channels\n'
    if role.permissions.ban_members:
        msg += '+ Ban Members\n'
    else:
        msg += '- Ban Members\n'
    if role.permissions.kick_members:
        msg += '+ Kick Members\n'
    else:
        msg += '- Kick Members\n'
    if role.permissions.view_audit_log:
        msg += '+ View Audit Log\n'
    else:
        msg += '- View Audit Log\n'
    if role.permissions.manage_messages:
        msg += '+ Manage Messages\n'
    else:
        msg += '- Manage Messages\n'
    if role.permissions.add_reactions:
        msg += '+ Add Reactions\n'
    else:
        msg += '- Add Reactions\n'
    if role.permissions.view_channel:
        msg += '+ Read Messages\n'
    else:
        msg += '- Read Messages\n'
    if role.permissions.send_messages:
        msg += '+ Send Messages\n'
    else:
        msg += '- Send Messages\n'
    if role.permissions.embed_links:
        msg += '+ Embed Links\n'
    else:
        msg += '- Embed Links\n'
    if role.permissions.read_message_history:
        msg += '+ Read Message History\n'
    else:
        msg += '- Read Message History\n'
    if role.permissions.view_guild_insights:
        msg += '+ View Guild Insights\n'
    else:
        msg += '- View Guild Insights\n'
    if role.permissions.connect:
        msg += '+ Join VC\n'
    else:
        msg += '- Join VC\n'
    if role.permissions.speak:
        msg += '+ Speak in VC\n'
    else:
        msg += '- Speak in VC\n'
    if role.permissions.change_nickname:
        msg += '+ Change Nickname\n'
    else:
        msg += '- Change Nickname\n'
    if role.permissions.manage_nicknames:
        msg += '+ Manage Nicknames\n'
    else:
        msg += '- Manage Nicknames\n'
    if role.permissions.manage_webhooks:
        msg += '+ Manage Webhooks\n'
    else:
        msg += '- Manage Webhooks\n'
    if role.permissions.manage_emojis:
        msg += '+ Manage Emojis\n'
    else:
        msg += '- Manage Emojis\n'
    msg += '\n```'
    em.add_field(name='Permissions:', value=msg, inline=False)
    em.set_footer(text='invite me ;)', icon_url=ctx.author.avatar_url)
    em.set_thumbnail(url=str(ctx.guild.icon_url))
    em.set_author(name=ctx.author.name, icon_url=ctx.author.avatar_url)
    (await ctx.send(embed=em))