#hello ๐Ÿ‘‹ question please so i came

1 messages ยท Page 1 of 1 (latest)

paper trellis
#

module.exports = {
    name: 'rolecount', //name of your command
    description: 'Count the number of members with roles in this server.', //description of your command
    run: async(client, message, args) => {
        let embed = new MessageEmbed()
        .setTitle(`Role Count`)
        .setDescription(`${message.guild.members.cache.filter(m => m.roles.cache.size == 1).size.toLocaleString()}`)
         message.channel.send({ embeds: [embed] })
    }
        }```
#

this is my code btw

pallid pier
#

not all members are cached, so you probably would have to use guild.members.fetch()

#

also you would need the GUILD_MEMBERS intent

paper trellis
#

@pallid pier its getting a result "unudefined"

#

im trying to message count of members with no rooles (only the @ everyone role)

#
    partials: ["MESSAGE", "CHANNEL", "REACTION",  "GUILD_MEMBER"],
    intents: 32767,
});```
#

this is my added intent

#

module.exports = {
    name: 'rolecount', //name of your command
    description: 'Count the number of members with roles in this server.', //description of your command
    run: async(client, message, args) => {
        let embed = new MessageEmbed()
        .setTitle(`Role Count`)
        .setDescription(`${message.guild.members.fetch(m => m.roles.cache.size == 1).size}`)
         message.channel.send({ embeds: [embed] })
    }
        }```
#

and the command's code

pallid pier
#
const members = await message.guild.members.fetch();

members.filter(...)```
rose shellBOT
paper trellis
#

@pallid pier yeah that did it

#

thank you so much buddy ๐Ÿ™