How can I count the number of messages in one chan

2019-09-06 05:43发布

问题:

I want to code a discord bot with the discord.js ... But in the documentation, I don't found a function to count the number of messages in a channel of each user... Is there a function to use the searchbar with filters like an user?

回答1:

The search is not ( yet ) avaible for Bots.

You could Channel#fetchMessages but this would be very Api intensive.

Best way would be to get a database and increment it when the user sends a message, but that will only count messages when the bot is running.