mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 21:24:59 +05:00
45 lines
No EOL
1.2 KiB
JavaScript
45 lines
No EOL
1.2 KiB
JavaScript
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
|
|
const BaseCommand = require("../../base/BaseCommand");
|
|
|
|
class Deletemod extends BaseCommand {
|
|
/**
|
|
*
|
|
* @param {import("../../base/JaBa")} client
|
|
*/
|
|
constructor(client) {
|
|
super({
|
|
command: new SlashCommandBuilder()
|
|
.setName("deletemod")
|
|
.setDescription(client.translate("administration/deletemod:DESCRIPTION"))
|
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageGuild)
|
|
.addBooleanOption(option => option.setName("state")
|
|
.setDescription(client.translate("common:STATE"))
|
|
.setRequired(true)),
|
|
aliases: [],
|
|
dirname: __dirname,
|
|
guildOnly: true
|
|
});
|
|
}
|
|
/**
|
|
*
|
|
* @param {import("../../base/JaBa")} client
|
|
*/
|
|
async onLoad() {
|
|
//...
|
|
}
|
|
/**
|
|
*
|
|
* @param {import("../../base/JaBa")} client
|
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
|
* @param {Object} data
|
|
*/
|
|
async execute(client, interaction, data) {
|
|
const state = interaction.options.getBoolean("state");
|
|
|
|
data.guildData.autoDeleteModCommands = state;
|
|
await data.guildData.save();
|
|
interaction.success(`administration/deletemod:${state ? "ENABLED" : "DISABLED"}`);
|
|
}
|
|
}
|
|
|
|
module.exports = Deletemod; |