K
K
Kratosterra2020-02-09 18:44:06
Python
Kratosterra, 2020-02-09 18:44:06

(Discord.py) How to get information from messages in a specific channel on a Discord server using a bot?

I'm building a Discord bot using the Discord.py module.

I want to get information from each message in a specific server channel.
I read the Discord.py documentation but could not figure out how to correctly collect information from messages that have already been sent a long time ago.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Taruu, 2020-07-21
@Kratosterra

First you need to get the channel itself using get_channel.
Then using fetch_message to get the message object itself

channel = await bot.get_channel(id чата)
message = await channel.fetch_message(id сообщения)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question