Reputation: 19
case 'sinfo':
const sinfo = new Discord.MessageEmbed()
.addField('Server Name 🔎 :', message.guild.name)
.setTitle('Server Information ')
.addField('Server Owner 👤 :', message.guild.owner.user.tag)
.addField('Members 👥 :', message.guild.memberCount)
.addField('Text Channels 💬 :', )
.addField('Voice Channels 🔊 :', )
.addField('All channels',)
.addField('Roles')
.addField('Region 🌍:', "")
.addField('Created At ⚙️ :', 'Sat Jan 27 2018 12:04:06')
.setFooter('For more commands check text channel ❕commands❕')
.setColor(0xF8F8F8)
.setThumbnail(message.guild.displayAvatarURL)
message.channel.send(sinfo);
I would need help with counting roles, text channels, voice channels and all channels. Automatic region would be apriciated aswell but its not necessary. I've serched on internet but I coudnt find it. The only one i could find was 2 years old...If its not possible just tell me I have no idea.
Upvotes: 0
Views: 627
Reputation: 317
To get collection of channels, do guild.channels.cache
. From this point, you can just get its length. For roles, do the same. And finally for text/voice channels, filter the all channels collection (via .filter()
function).
Upvotes: 1