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?
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?
Share Improve this question asked Apr 14, 2019 at 8:30 itrangeritranger 1852 gold badges2 silver badges15 bronze badges2 Answers
Reset to default 2The 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.
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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745614664a4636159.html
评论列表(0条)