I want to send guild name list in channel that have less than 10 member. {USING discord.js v13}
My code
guild.channels.cache.forEach((channel) => {
if (channel.type === 'text' && !targetChannel && channel.permissionsFor(guild.me).has("SEND_MESSAGES")) targetChannel = channel
})
if(guild.memberCount < 10 ) {
message.channel.send (guild.name);
}
You can just do
client.guilds.cache.forEach(g => {
if(g.memberCount < 10) {
message.channel.send(g.name)
}
})