2022-07-29 23:31:08 +05:00
|
|
|
const Command = require("../../base/Command"),
|
2022-07-31 17:08:00 +05:00
|
|
|
{ PermissionsBitField, EmbedBuilder } = require("discord.js");
|
2022-07-29 23:31:08 +05:00
|
|
|
|
|
|
|
class Staff extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: "staff",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: true,
|
|
|
|
aliases: ["staf"],
|
|
|
|
memberPermissions: [],
|
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
|
|
|
cooldown: 1000
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(message, args, data) {
|
|
|
|
await message.guild.members.fetch();
|
2022-07-31 17:08:00 +05:00
|
|
|
const administrators = message.guild.members.cache.filter((m) => m.permissions.has(PermissionsBitField.Flags.Administrator) && !m.user.bot);
|
|
|
|
const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(PermissionsBitField.Flags.ManageMessages) && !m.user.bot);
|
|
|
|
const embed = new EmbedBuilder()
|
2022-07-29 23:31:08 +05:00
|
|
|
.setAuthor({
|
|
|
|
name: message.translate("general/staff:TITLE", {
|
|
|
|
guild: message.guild.name
|
|
|
|
})
|
|
|
|
})
|
2022-07-31 17:08:00 +05:00
|
|
|
.addFields([
|
|
|
|
{
|
|
|
|
name: message.translate("general/staff:ADMINS"),
|
|
|
|
value: (administrators.size > 0 ? administrators.map((a) => `${a.presence ? this.client.customEmojis.status[a.presence.status] : this.client.customEmojis.status.offline} | <@${a.user.id}>`).join("\n") : message.translate("general/staff:NO_ADMINS"))
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: message.translate("general/staff:MODS"),
|
|
|
|
value: (moderators.size > 0 ? moderators.map((m) => `${m.presence ? this.client.customEmojis.status[m.presence.status] : this.client.customEmojis.status.offline} | <@${m.user.id}>`).join("\n") : message.translate("general/staff:NO_MODS"))
|
|
|
|
}
|
|
|
|
])
|
2022-07-29 23:31:08 +05:00
|
|
|
.setColor(data.config.embed.color)
|
|
|
|
.setFooter({
|
|
|
|
text: data.config.embed.footer
|
|
|
|
});
|
|
|
|
message.reply({
|
|
|
|
embeds: [embed]
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Staff;
|