Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
3

How can I make the bot give me a certain role when I type the command for it?

Popzular
Popzular

need help. dont know what

2 years ago

Voters

Comments

TopNew
1
ErrorNoInternet
ErrorNoInternet

You need to specify a role first, then add the role to the user.
Example code:

adminRole = discord.utils.get(message.author.guild.roles, name = "Admin")
await message.author.add_roles(adminRole)

2 years ago
2
Popzular
Popzular

@ErrorNoInternet
what am I missing?

2 years ago
1
ErrorNoInternet
ErrorNoInternet

@Popzular
Nothing else is missing, please note that you need a role on your server called "Test" for the command to work. I don't know how to create roles as a bot, but I think its:
await client.create_role(message.author.server, name="role name")

2 years ago
Load more