Skip to content Skip to sidebar Skip to footer

How Can I Count The Number Of Messages In One Channel Of Each User?

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 func

Solution 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.

Solution 2:

The above works. But if you did not implement the feature into the bot. One way is to do a search using in: channel(whatever channel you want) and it will show you the result count which is technically the message count in that channel. Hope it helped.

Post a Comment for "How Can I Count The Number Of Messages In One Channel Of Each User?"