I am trying to make on reaction edit embed...
@bot.event
async def on_raw_reaction_add(payload):
channel = await bot.fetch_channel(payload.channel_id)
message = await channel.fetch_message(payload.message_id)
if payload.emoji.name == "✅":
await message.set_field_at(4,"Status:","Accepted")
elif payload.emoji.name == "❎":
await message.set_field_at(4,"Status:","Denied")
elif payload.emoji.name == "❌":
await message.set_field_at(4,"Status:","Canceled")
else:
pass
Error given:
AttributeError: 'Message' object has no attribute 'set_field_at'
I don't know why this is happening...
According to the documentation: https://discordpy.readthedocs.io/en/stable/api.html?highlight=fetch_emoji#discord.Guild.fetch_emoji
You want to call
await fetch_emoji(id)with the emoji id and not thePartialEmojiobject (which your emoji variable is). Instead usefetch_emoji(emoji.id)Try the following: