我要在某些用户做出反应时赋予他们角色,但它说discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions并且该机器人具有管理员权限这是我的代码:@bot.eventasync def on_raw_reaction_add(payload): emoji = payload.emoji.name canal = payload.channel_id message = payload.message_id python_role = get(bot.get_guild(payload.guild_id).roles, name="python") member = bot.get_guild(payload.guild_id).get_member(payload.user_id) if canal == 703637575566491731 and message == 703643218658459778 and emoji == "python": await membre.add_roles(python_role)错误代码: Ignoring exception in on_raw_reaction_addTraceback (most recent call last): File "C:\Users\****\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 312, in _run_event await coro(*args, **kwargs) File "C:/Users/****/PycharmProjects/tp's/bot discord/main.py", line 30, in on_raw_reaction_add await membre.add_roles(python_role) File "C:\Users\****\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\member.py", line 641, in add_roles await req(guild_id, user_id, role.id, reason=reason) File "C:\Users\****\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\http.py", line 221, in request raise Forbidden(r, data)discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
2 回答
慕桂英3389331
TA贡献2036条经验 获得超8个赞
机器人的角色必须高于给用户的角色。
还有一个拼写错误:await membre.add_roles(python_role) membr/member
添加回答
举报
0/150
提交
取消

