Created
January 10, 2021 05:37
-
-
Save psenger/d14f62da74f2a21045b6ded2bb7911c6 to your computer and use it in GitHub Desktop.
[Discord Give Role] #Python #Discord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from discord.utils import get | |
| @client.command(pass_context=True) | |
| async def giverole(ctx, member: discord.Member, *, role: discord.Role): | |
| check_role = get(ctx.message.server.roles, name='Board of Executives') | |
| if check_role not in member.roles: | |
| await client.say(f"You don't have the role '{str(role)}'") | |
| else: | |
| await client.add_roles(member, role) | |
| await client.say(f"The role '{str(role)}' has been given to {member.mention}.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment