M
M
Michal Palych2020-08-25 21:15:54
Python
Michal Palych, 2020-08-25 21:15:54

How to get all user roles on the server?

Good evening everyone! How to get a list of roles from a user?
I do it like this:

@Bot.command(aliases = ['i', 'information', 'INFO', 'INFORMATION'])
async def info(ctx, member: discord.Member):
    mentions = [role.mention for role in member.roles if role.mentionable]
    embed = discord.Embed(title = "Info", color = 0x428325)
    embed.add_field(name = "Когда присоединился: ", value = member.joined_at)
    embed.add_field(name = "Имя юзера: ", value = member.display_name)
    embed.add_field(name = "Роли имеет: ", value = "\n".join(mentions))
    embed.set_thumbnail(url = member.avatar_url)
    embed.set_footer(text = "supports by quantprod")
    await ctx.send(embed = embed)

it doesn't work... The bot gets one role and that's it, nothing further...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michal Palych, 2020-08-25
@SenqHabr

solution: https://stackoverflow.com/questions/62328643/disco...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question