R
R
RieldaBot2021-12-05 16:26:59
Python
RieldaBot, 2021-12-05 16:26:59

Discord.py | How to make custom reactions in discord?

I have this code:

@client.command()
@commands.has_permissions(administrator=True)
async def notification(ctx, *, text,):
  await ctx.message.delete()
  file = discord.File("image2.png")
  date = datetime.now().date().strftime('%d.%m.%y')
  channel = client.get_channel(915650510168666112)
  embed=discord.Embed(title=f"Новости Discord сервера за {date}", description=text, color=0x2f3136)
  embed.set_image(url = "attachment://image2.png")
  await channel.send(embed=embed, file=file)
  message = await channel.send('||<@&916748143683575889>||')
  emoji1 = '\U0001F44D'
  emoji2 = '\U0001F44E'
  await message.add_reaction(emoji1)
  await message.add_reaction(emoji2)

I tried different ways to add custom reactions from servers, but they didn't work for me.
How to add custom emojis to the message of the discord server from this code? discord.py
ps If you need emoji IDs, then here:
<:like:917043906330382357>;
<:dislike:917043977142829076>.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wolf_Yout, 2021-12-13
@Wolf_Yout

Enter these and IDs, that is:

await message.add_reaction('<:like:917043906330382357>')

If it doesn't work, try removing the quotes (because I don't remember if they are needed or not)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question