如何在raw_reactions_add上分配角色?我卡在这部分上
代码
@bot.event
async def on_raw_reaction_add(payload):
msgID = 754487460142121070
role = get(payload.member.roles, name='penis')
user = payload.user_id
if payload is not None:
if payload.message_id == msgID:
if str(payload.emoji) == "<:bbc:639345897922101248>":
await bot.add_roles(role)
错误
文件“ /Users/CIP/Documents/GitHub/billionaireboysclub/lojinha.py”, 第137行,在on_raw_reaction_add中 等待client.add_roles(role)NameError:名称“ bot”未定义