2021-12-10 21:39:54 +05:00
|
|
|
const Command = require("../../base/Command.js"),
|
|
|
|
Discord = require("discord.js");
|
|
|
|
|
|
|
|
class Staff extends Command {
|
2021-12-26 19:29:37 +05:00
|
|
|
constructor(client) {
|
2021-12-10 21:39:54 +05:00
|
|
|
super(client, {
|
|
|
|
name: "staff",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: true,
|
2022-01-01 00:50:09 +05:00
|
|
|
aliases: ["stafflist"],
|
2021-12-10 21:39:54 +05:00
|
|
|
memberPermissions: [],
|
2021-12-26 19:29:37 +05:00
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
2021-12-10 21:39:54 +05:00
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
2022-01-01 00:50:09 +05:00
|
|
|
cooldown: 1000
|
2021-12-10 21:39:54 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-26 19:29:37 +05:00
|
|
|
async run(message, args, data) {
|
2021-12-10 21:39:54 +05:00
|
|
|
await message.guild.members.fetch();
|
2022-01-03 23:20:33 +05:00
|
|
|
const administrators = message.guild.members.cache.filter((m) => m.permissions.has(Discord.Permissions.FLAGS.ADMINISTRATOR) && !m.user.bot);
|
|
|
|
const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(Discord.Permissions.FLAGS.MANAGE_MESSAGES) && !m.user.bot);
|
2021-12-10 21:39:54 +05:00
|
|
|
const embed = new Discord.MessageEmbed()
|
2022-01-03 23:20:33 +05:00
|
|
|
.setAuthor({ name: message.translate("general/staff:TITLE", {
|
2021-12-26 19:29:37 +05:00
|
|
|
guild: message.guild.name
|
2022-01-03 23:20:33 +05:00
|
|
|
})})
|
2021-12-18 19:27:10 +05:00
|
|
|
.addField(message.translate("general/staff:ADMINS"), (administrators.size > 0 ? administrators.map((a) => `${this.client.customEmojis.status[a.presence.status]} | <@${a.user.id}>`).join("\n") : message.translate("general/staff:NO_ADMINS")))
|
|
|
|
.addField(message.translate("general/staff:MODS"), (moderators.size > 0 ? moderators.map((m) => `${this.client.customEmojis.status[m.presence.status]} | <@${m.user.id}>`).join("\n") : message.translate("general/staff:NO_MODS")))
|
2021-12-10 21:39:54 +05:00
|
|
|
.setColor(data.config.embed.color)
|
2022-01-03 23:20:33 +05:00
|
|
|
.setFooter({ text: data.config.embed.footer });
|
|
|
|
message.channel.send({ embeds: [embed] });
|
2021-12-10 21:39:54 +05:00
|
|
|
}
|
2021-12-11 01:11:50 +05:00
|
|
|
};
|
2021-12-10 21:39:54 +05:00
|
|
|
|
|
|
|
module.exports = Staff;
|