Update reset command

This commit is contained in:
Skylar Grant 2023-02-19 18:36:42 -05:00
parent 71557b1942
commit c3d3be33d7
2 changed files with 7 additions and 4 deletions

View File

@ -57,7 +57,9 @@
"missingLeaderboardMessage": "There was a problem finding the Tallest Trees message. Please make sure the ``/tree`` and ``/top trees`` messages are in this channel, or run </setup:1065407649363005561> to set the ``/tree`` and ``/top trees`` channels.",
"missingLeaderboardChannel": "There was a problem finding the Tallest Trees channel, was it deleted? Please make sure the ``/tree`` and ``/top trees`` messages are in this channel, or run </setup:1065407649363005561> to set the ``/tree`` and ``/top trees`` channels.",
"missingTreeMessage": "There was a problem finding the Tree message. Please make sure the ``/tree`` and ``/top trees`` messages are this channel, or run </setup:1065407649363005561> to set the ``/tree`` and ``/top trees`` channels.",
"missingTreeChannel": "There was a problem finding the Tree channel, was it deleted? Please make sure the ``/tree`` and ``/top trees`` messages are in this channel, or run </setup:1065407649363005561> to set the ``/tree`` and ``/top trees`` channels."
"missingTreeChannel": "There was a problem finding the Tree channel, was it deleted? Please make sure the ``/tree`` and ``/top trees`` messages are in this channel, or run </setup:1065407649363005561> to set the ``/tree`` and ``/top trees`` channels.",
"reset": "All guild configuration information has been removed from the database.",
"resetError": "There was a problem deleting your guild information, contact @voidf1sh#0420 for help."
},
"notifications": {
"water": "is ready to be watered again!",

View File

@ -1,5 +1,6 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
const fn = require('../modules/functions.js');
const strings = require('../data/strings.json');
module.exports = {
data: new SlashCommandBuilder()
@ -8,13 +9,13 @@ module.exports = {
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
execute(interaction) {
interaction.deferReply({ ephemeral: true }).then(() => {
fn.reset(interaction.guildId).then(res => {
interaction.editReply(fn.builders.embed("Assignments Reset")).catch(err => {
fn.reset(interaction).then(res => {
interaction.editReply(fn.builders.embed(strings.status.reset)).catch(err => {
console.error(err);
});
}).catch(err => {
console.error(err);
interaction.editReply("There was a problem deleting your guild information, contact @voidf1sh#0420 for help.").catch(err => {
interaction.editReply(strings.status.resetError).catch(err => {
console.error(err);
});
});