Discord.py | add role to someone

后端 未结 4 1622
别跟我提以往
别跟我提以往 2021-01-07 01:44

I have trouble with making an "add role" command in discord.py. I don\'t know what is wrong; it just doesn\'t work.

@client.command()
@commands.has_         


        
4条回答
  •  春和景丽
    2021-01-07 02:20

    @client.command()
    async def addrole(ctx, member : discord.Member, role : discord.Role):
        await member.add_roles(role)
    

    usage: !addrole [member] [role]

    NOTE : the bot can only give roles lower than him !

提交回复
热议问题