B
B
BarasheX2020-04-20 18:59:43
Python
BarasheX, 2020-04-20 18:59:43

How to make the bot give out roles in discord?

I am writing my bot and I need that when I wrote for example: "Give @nickname @role" then the user was given the role that I specified? I write in Python

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Soneiko, 2020-04-30
@Soneiko

@client.comand(pass_contention = True)
async def giverole(ctx, member: discord.Member, role = discord.Role):
getrole = discord.utils.get(ctx.guild.roles id = role )
await member.add_roles( getrole)
like so.
all here https://discordpy.readthedocs.io/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question