V
V
VladosYT2022-04-07 18:52:58
opencart
VladosYT, 2022-04-07 18:52:58

How to change a post by its id in Python?

The code:

emb = discord.Embed(title = 'Текст', color = 0xF1C232)
msg = client.get_guild(guild_id).get_channel(channel_id).fetch_message(message_id)
await msg.edit(embed = emb)


Mistake:
AttributeError: 'coroutine' object has no attribute 'edit'


Discord.py library
I will be very grateful for the help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
web-mechanic, 2016-09-01
@amfetamine

if you want to automatically make a product new for some time, then bind the "New" flag to the difference between the product creation date and the current date. Accordingly, if there are less than some days, then a novelty, more - not a novelty.

S
Shandy, 2022-04-07
@VladosYT

Decision:

msg = await client.get_guild(inter.guild.id).get_channel(xx2).fetch_message(xx)

https://discordpy.readthedocs.io/en/latest/api.htm...
spoiler
продублировал ответ из комментариев

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question