From 6cb710c6a69fa7e1c4ddd0ac045a053efaf047b2 Mon Sep 17 00:00:00 2001 From: baz Date: Sat, 20 Apr 2024 16:33:24 +0100 Subject: [PATCH] Unify No Games Found response in /searchgames --- commands/100-games/searchGames.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/commands/100-games/searchGames.js b/commands/100-games/searchGames.js index e4f6435..f00f9e7 100644 --- a/commands/100-games/searchGames.js +++ b/commands/100-games/searchGames.js @@ -14,12 +14,21 @@ module.exports = { let games = await searchGamesWithMinimumReview(gamename); if (games.length == 0) games = await searchGamesWithoutMinimumReview(gamename); + let description = ''; - if (games.length == 0) return interaction.editReply({ content: 'No games found.', ephemeral: true }); + if (games.length == 0) { + description = 'No games found.'; + + const embed = new EmbedBuilder() + .setTitle(`"${gamename}" Search Results`) + .setDescription(`${description.slice(0, 1998)}`) + .setColor(0x6441a5); + + return await interaction.editReply({ embeds: [embed] }); + } await games.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count)); - let description = ''; for (const game of games) { if (game.first_release_date && (game.category == 0 || game.category == 4 || game.category == 8 || game.category == 9)) {