From 18491f9225a41f422d8c9dd2778a8bbef0797050 Mon Sep 17 00:00:00 2001 From: baz Date: Sat, 30 Dec 2023 01:31:56 +0000 Subject: [PATCH] Delete databaseentryid parameter from deleteGameEntry command --- commands/100-games/deleteGameEntry.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/commands/100-games/deleteGameEntry.js b/commands/100-games/deleteGameEntry.js index 8e58a19..289dc96 100644 --- a/commands/100-games/deleteGameEntry.js +++ b/commands/100-games/deleteGameEntry.js @@ -1,23 +1,18 @@ const { SlashCommandBuilder } = require('discord.js'); -const { deleteBeatenGameId, getUserRegistration, deleteBeatenGameNum, checkGameStorageId } = require('../../databaseHelperFunctions.js'); +const { getUserRegistration, deleteBeatenGameNum, checkGameStorageId } = require('../../databaseHelperFunctions.js'); module.exports = { data: new SlashCommandBuilder() .setName('deletegameentry') .setDescription('Delete a game that you have beaten from the 100 game challenge!') - .addNumberOption(option => option.setName('databaseentryid').setDescription('The beat game id.').setMinValue(1)) .addNumberOption(option => option.setName('beatgamenumber').setDescription('Index of the game to delete in the list of beaten games.').setMinValue(1).setMaxValue(100)), async execute(interaction) { - const databaseEntryId = interaction.options.getNumber('databaseentryid'); const beatGameNumber = interaction.options.getNumber('beatgamenumber'); - if (!databaseEntryId && !beatGameNumber) return interaction.reply({ content: 'No parameters supplied.', ephemeral: true }); - const userDatabaseEntry = await getUserRegistration(interaction.user); let result; - if (databaseEntryId) { - result = await deleteBeatenGameId(databaseEntryId, userDatabaseEntry); - } else if (beatGameNumber) { + + if (beatGameNumber) { result = await deleteBeatenGameNum(beatGameNumber, userDatabaseEntry); }