How can I count the number of messages in one channel of each user?

人盡茶涼 提交于 2019-12-11 16:04:34

问题


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.



来源:https://stackoverflow.com/questions/55673386/how-can-i-count-the-number-of-messages-in-one-channel-of-each-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!