I want my bot to make a reaction role when I say p!reactrole [emoji] [role] [message]
, but it isn't working. No errors or anything.
@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)