Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @commands.command(pass_context=True, no_pm=True, name='list', aliases=['roles', 'role'])
- async def _list(self, ctx):
- """List of all available roles """
- guild = ctx.message.guild
- author = ctx.message.author
- botroom = self.bot.get_channel(555844758778544160)
- intros = self.bot.get_channel(485381365366390796)
- #--- Role list Categories ---"
- Colours = ['Blue', 'Green', 'Orange', 'Yellow', 'Pink', 'Purple']
- Colours.sort(key=str.lower)
- Games = ['LoL', 'WoW', 'Overwatch']
- Games.sort(key=str.lower)
- Platforms = ['PC', 'Xbox', 'PS4', 'Nintendo Switch']
- Platforms.sort(key=str.lower)
- if ctx.message.channel == intros:
- pass
- else:
- if ctx.message.channel == botroom:
- title = '**Hey {}, here is a list of roles you can add:**'.format(author.display_name)
- embed = discord.Embed(title=title.format(), colour=0x0080c0)
- embed.add_field(name="**Have a role suggestion?**", value="If you can't find the role you want but would like to see it added to the roles list please tell us in <#555371532390760473>.", inline=False)
- embed.set_footer(text="Tip: to add a role from the list type the command !add/remove followed by the role.")
- #Lets start embed roles list below#
- for role in Colours:
- embed.add_field(name="**Colour Roles**", value="""\n{} **({})**""".format(role, len([member for member in guild.members if ([r for r in member.roles if r.name == role])])), inline=True)
- for role in Games:
- embed.add_field(name="**Game Roles**", value="""\n{} **({})**""".format(role, len([member for member in guild.members if ([r for r in member.roles if r.name == role])])), inline=True)
- for role in Platforms:
- embed.add_field(name="**Plaforms Roles**", value="\n{} **({})**".format(role, len([member for member in guild.members if ([r for r in member.roles if r.name == role])])), inline=True)
- await ctx.send(embed=embed)
- else:
- await ctx.send('You can only use this command in {}.'.format(botroom.mention))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement