silvanus/slash-commands/reset.js

26 lines
823 B
JavaScript
Raw Normal View History

2023-02-17 13:37:10 +00:00
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
const fn = require('../modules/functions.js');
2023-02-19 23:36:42 +00:00
const strings = require('../data/strings.json');
module.exports = {
data: new SlashCommandBuilder()
.setName('reset')
2023-02-17 13:35:06 +00:00
.setDescription('Reset all message assignments in your server')
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
execute(interaction) {
interaction.deferReply({ ephemeral: true }).then(() => {
2023-02-19 23:36:42 +00:00
fn.reset(interaction).then(res => {
interaction.editReply(fn.builders.embed(strings.status.reset)).catch(err => {
console.error(err);
});
}).catch(err => {
console.error(err);
2023-02-19 23:36:42 +00:00
interaction.editReply(strings.status.resetError).catch(err => {
console.error(err);
});
});
}).catch(err => {
console.error(err);
});
},
};