From fa9c12277b92d3bfb33df0df3f71e16e7efa80dd Mon Sep 17 00:00:00 2001 From: baz Date: Sun, 9 Jun 2024 22:06:42 +0100 Subject: [PATCH] Let duplicate entries silently fail Closes #14 --- commands/100-games/beatGame.js | 2 +- commands/100-games/planGame.js | 2 +- commands/100-games/startplaying.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/100-games/beatGame.js b/commands/100-games/beatGame.js index ece4262..fd5522d 100644 --- a/commands/100-games/beatGame.js +++ b/commands/100-games/beatGame.js @@ -46,7 +46,7 @@ module.exports = { const gameDatabaseEntry = await checkGameStorage(game); - if (!(await createBeatenGameEntry(userDatabaseEntry, gameDatabaseEntry))) return interaction.editReply({ content: `${game.name} already beaten.`, ephemeral: true }); + await createBeatenGameEntry(userDatabaseEntry, gameDatabaseEntry); const beatNum = await getBeatenGameCount(userDatabaseEntry); const planNum = await getPlanningGameCount(userDatabaseEntry); diff --git a/commands/100-games/planGame.js b/commands/100-games/planGame.js index 05782ae..e4ce3e9 100644 --- a/commands/100-games/planGame.js +++ b/commands/100-games/planGame.js @@ -40,7 +40,7 @@ module.exports = { const game = res[0]; const gameDatabaseEntry = await checkGameStorage(game); - if (!(await createPlanningGameEntry(userDatabaseEntry, gameDatabaseEntry))) return interaction.editReply({ content: `${game.name} already planned.`, ephemeral: true }); + await createPlanningGameEntry(userDatabaseEntry, gameDatabaseEntry); const beatNum = await getBeatenGameCount(userDatabaseEntry); const planNum = await getPlanningGameCount(userDatabaseEntry); diff --git a/commands/100-games/startplaying.js b/commands/100-games/startplaying.js index bae144a..ff86258 100644 --- a/commands/100-games/startplaying.js +++ b/commands/100-games/startplaying.js @@ -43,7 +43,7 @@ module.exports = { const gameDatabaseEntry = await checkGameStorage(game); - if (!(await createPlayingGameEntry(userDatabaseEntry, gameDatabaseEntry))) return interaction.editReply({ content: `${game.name} already currently being played.`, ephemeral: true }); + await createPlayingGameEntry(userDatabaseEntry, gameDatabaseEntry); const beatNum = await getBeatenGameCount(userDatabaseEntry); const planNum = await getPlanningGameCount(userDatabaseEntry);