javascript - How can I count the number of messages in one channel of each user? - Stack Overflow

I want to code a discord bot with the discord.js ... But in the documentation, I don't found a fun

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 badges
Add a ment  | 

2 Answers 2

Reset to default 2

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.

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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信