discord.py 反应作用不起作用我添加了意图 而且还是不行
@client.command()
async def reactrole(ctx, emoji, role: discord.Role, *, message):
embedVar = discord.Embed(description=message)
msg = await ctx.channel.send(embed=embedVar)
await msg.add_reaction(emoji)
with open('reactrole.json') as json_file:
data = json.load(json_file)
new_react_role = {
'role_name': role.name,
'role_id': role.id,
'emoji': emoji,
'message_id': msg.id
}
data.append(new_react_role)
with open('reactrole.json', 'w') as j:
json.dump(data, j, indent=4)