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

j0hnmeow picture j0hnmeow  路  3Comments

Yolotroll101 picture Yolotroll101  路  3Comments

AraHaan picture AraHaan  路  3Comments

adhoc92 picture adhoc92  路  3Comments

danshat picture danshat  路  3Comments