admin管理员组

文章数量:1025251

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.

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.

本文标签: javascriptHow can I count the number of messages in one channel of each userStack Overflow