2021-09-06 12:38:25 +02:00
|
|
|
|
const { MessageEmbed } = require("discord.js");
|
|
|
|
|
module.exports = {
|
|
|
|
|
name: "guilds",
|
|
|
|
|
category: "Owner",
|
|
|
|
|
description: "Check top 10 guilds of the bot",
|
|
|
|
|
Owner: true,
|
2021-11-18 18:56:42 +01:00
|
|
|
|
run: async (client, interaction) => {
|
2021-09-06 12:38:25 +02:00
|
|
|
|
const guilds = client.guilds.cache
|
|
|
|
|
.sort((a, b) => b.memberCount - a.memberCount)
|
|
|
|
|
.first(10);
|
|
|
|
|
const description = guilds
|
|
|
|
|
.map((guild, index) => {
|
2021-11-18 18:56:42 +01:00
|
|
|
|
return `**${index + 1}❯** ${guild.name} =❯ ${
|
|
|
|
|
guild.memberCount
|
|
|
|
|
} members`;
|
2021-09-06 12:38:25 +02:00
|
|
|
|
})
|
|
|
|
|
.join("\n");
|
2021-11-18 18:56:42 +01:00
|
|
|
|
const embed = new MessageEmbed()
|
2021-09-06 12:38:25 +02:00
|
|
|
|
.setTitle("Guilds")
|
|
|
|
|
.setDescription(description)
|
2021-12-24 08:45:42 +01:00
|
|
|
|
.addFields(
|
|
|
|
|
{
|
|
|
|
|
name: `Total Guilds`,
|
|
|
|
|
value: client.guilds.cache.size,
|
|
|
|
|
inline: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: `Total Members`,
|
|
|
|
|
value: client.users.cache.size,
|
|
|
|
|
inline: true
|
|
|
|
|
}
|
|
|
|
|
)
|
2021-09-06 12:38:25 +02:00
|
|
|
|
.setColor(client.color)
|
2022-01-15 22:35:02 +01:00
|
|
|
|
.addFields(
|
|
|
|
|
{
|
|
|
|
|
name: `Total Guilds`,
|
|
|
|
|
value: client.guilds.cache.size,
|
|
|
|
|
inline: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: `Total Members`,
|
|
|
|
|
value: client.users.cache.size,
|
|
|
|
|
inline: true,
|
|
|
|
|
}
|
|
|
|
|
)
|
2021-11-18 18:56:42 +01:00
|
|
|
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
2021-09-06 12:38:25 +02:00
|
|
|
|
.setTimestamp();
|
|
|
|
|
interaction.followUp({ embeds: [embed] });
|
|
|
|
|
},
|
|
|
|
|
};
|