N
N
Nolrox2022-02-09 15:50:18
Python
Nolrox, 2022-02-09 15:50:18

How to make the discord.py bot get the number of messages in a channel?

For example: the command "!messages" is written in the channel, and the bot sends the total number of messages in this channel. Is it possible to do so?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-02-09
@Nolrox

First, it is possible, but not worth it.
Discord doesn't bother keeping such statistics, or makes them available.
Those. you will have to download and read ALL messages in the channel, which will cause a wild load on the bot.
Yes, and you can easily fly beyond the limits of calls to the api.
Second, why?
I'm at a loss to come up with an example when this information is needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question