Find bot in server

I need to find all bots in the server even if it does offline
const bots = message.guild.members.cache.filter(member => member.user.bot);
let reply = "Here's a list of bots in this server:\n";
let count = 1;
bots.forEach(bot => {
reply += `${count}. <@${bot.user.id}>\n`;
count++;
});

message.channel.send(reply).catch(console.error);
const bots = message.guild.members.cache.filter(member => member.user.bot);
let reply = "Here's a list of bots in this server:\n";
let count = 1;
bots.forEach(bot => {
reply += `${count}. <@${bot.user.id}>\n`;
count++;
});

message.channel.send(reply).catch(console.error);
The results are not accurate. That server has 40 bots, but it appears to be abnormal. 3 Intents is already open I thank Why it count message to find bot in discord server? Not members list?
No description
No description
No description
4 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
BroSophan
BroSophan3mo ago
So…. “message.guild.members.fetch()”
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View