R
R
RieldaBot2021-12-04 17:37:59
Python
RieldaBot, 2021-12-04 17:37:59

Discord.py | How to add emoji to Embed?

How to add a reaction to an embed message?

i have this code:

@client.command()
@commands.has_permissions(administrator=True)
async def notification(ctx, *, text):
  date = datetime.now().date().strftime('%d.%m.%y')
  channel = client.get_channel(906802938159185932)
  embed=discord.Embed(title=f"Новости Discord сервера за {date}", description=text, color=0x2f3136)
  await channel.send(embed=embed)
  await channel.add_reaction('')

gives the following error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'TextChannel' object has no attribute 'add_reaction'


site doesn't save emoji

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vindicar, 2021-12-04
@Vindicar

await channel.add_reaction('')
reactions can only be added to messages, not channels.

L
LXSTVAYNE, 2021-12-04
@lxstvayne

https://discordpy.readthedocs.io/en/stable/api.htm...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question