from discord.ext import commands client = commands.Bot(command_prefix='m.') token = 'a token goes here' @client.command() async def player(ctx): role = discord.utils.get(ctx.guild.roles, name = "player") if role is not None: await ctx.author.add_roles(role) client.run(token)
You need to have the
player role in your server too. The user sends
m. player as example and the bot gives him that role.
CLICK HERE to find out more related problems solutions.