Discord.py: How do you use add_roles

Created on 19 Feb 2018  路  2Comments  路  Source: Rapptz/discord.py

I've been trying to use this function, but I can't figure out how to make it work. I need some kind of example to work off of.

question

Most helpful comment

For rewrite branch it's
await some_member_object.add_roles(*[role_object1, role_object2])
For async branch it's
await client.add_roles(some_member_object, *[role_object1, role_object2])

Member objects can be obtained as attributes of message objects, (or server objects) and role objects are usually obtained by iterating through server.roles

For future reference, similar questions are best asked on the discord https://discord.gg/r3sSKJJ

All 2 comments

For rewrite branch it's
await some_member_object.add_roles(*[role_object1, role_object2])
For async branch it's
await client.add_roles(some_member_object, *[role_object1, role_object2])

Member objects can be obtained as attributes of message objects, (or server objects) and role objects are usually obtained by iterating through server.roles

For future reference, similar questions are best asked on the discord https://discord.gg/r3sSKJJ

Thanks! That helps a lot!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johndoe434 picture johndoe434  路  21Comments

AceKiron picture AceKiron  路  23Comments

VoxelPrismatic picture VoxelPrismatic  路  16Comments

pappabewar picture pappabewar  路  26Comments

SakiiR picture SakiiR  路  17Comments