nyx/commands/Owner/guilds.js

25 lines
741 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "guilds",
category: "Owner",
description: "Check top 10 guilds of the bot",
Owner: true,
run: async (client, message, args) => {
const guilds = client.guilds.cache
.sort((a, b) => b.memberCount - a.memberCount)
.first(10);
const description = guilds
.map((guild, index) => {
return `${index + 1}) ${guild.name} -> ${guild.memberCount}members`;
})
.join("\n");
let embed = new MessageEmbed()
.setTitle("Guilds")
.setDescription(description)
.setColor(client.color)
2021-06-24 09:53:19 +02:00
.setFooter(`Made by ${client.author}`)
2021-06-12 12:53:51 +02:00
.setTimestamp();
message.channel.send(embed);
},
};