const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('serverstats') .setDescription('Shows detailed server statistics in an embed.'), async execute(interaction) { const { guild } = interaction; await guild.members.fetch(); const totalMembers = guild.memberCount; const humans = guild.members.cache.filter(m => !m.user.bot).size; const bots = guild.members.cache.filter(m => m.user.bot).size; const online = guild.members.cache.filter(m => m.presence && m.presence.status !== 'offline').size; const textChannels = guild.channels.cache.filter(ch => ch.type === 0).size; const voiceChannels = guild.channels.cache.filter(ch => ch.type === 2).size; const boostCount = guild.premiumSubscriptionCount; const boostLevel = guild.premiumTier; const embed = new EmbedBuilder() .setTitle(`πŸ“Š ${guild.name} | Server Stats`) .setThumbnail(guild.iconURL({ dynamic: true })) .setColor('Blurple') .setDescription( `Here’s a quick overview of **${guild.name}**:\n\n` + `πŸ‘₯ **Total Members:** ${totalMembers}\n` + `πŸ§β€β™‚οΈ **Humans:** ${humans}\n` + `πŸ€– **Bots:** ${bots}\n` + `🟒 **Online Members:** ${online}\n` + `πŸ’¬ **Text Channels:** ${textChannels}\n` + `🎧 **Voice Channels:** ${voiceChannels}\n` + `πŸš€ **Boost Level:** ${boostLevel} (${boostCount} boosts)\n` + `πŸ—“οΈ **Created On:** \n` ) .setFooter({ text: `Guild ID: ${guild.id}` }) .setTimestamp(); await interaction.reply({ embeds: [embed] }); } };