I am trying to see how many users my bot could be interacted with (like how many users are in the guilds my bot is in)
module.exports.run = async (bot, message, args) => { if (!message.member.id === 'myid') return; message.channel.send(`Watching ${bot.users.size} users!`); } module.exports.config = { name: "users", aliases: [] }
I also get this error TypeError: Cannot read property 'size' of undefined I know its silly but I just cant find it. Thanks in advance !
TypeError: Cannot read property 'size' of undefined
Try message.guild.memberCount this will return total user count from which guild the command is executed from.
message.guild.memberCount
1.4m articles
1.4m replys
5 comments
56.9k users