G
G
Grigory Griksovshchik2022-03-22 10:45:28
Bots
Grigory Griksovshchik, 2022-03-22 10:45:28

How to edit a bot message in Discord // python?

There is a bot on the server.
There is a text channel "server", which is in the "general" category.
Inside this channel there is a message from the bot.
How to make sure that the bot can edit this particular message at any time, even after a restart?

For example: I wrote the command "!text asasas123" in the chat, after which the message in the "server" channel changed to "asasas123"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-03-22
@gtbtop

If you use discord.py, then something like this
1. Find out the channel id (it is unchanged, you can write it in the code), get its object through the .fetch_channel ()
bot method 2. Find out the message id (it is unchanged, you can write it in the code ), get the message object via the channel 's .fetch_message()
method 3. Call the .edit() method of the message.
Read the documentation, there's a lot of interesting stuff in there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question