diff --git a/commands/100-games/searchGame.js b/commands/100-games/searchGame.js index b526cc2..1f2f4ac 100644 --- a/commands/100-games/searchGame.js +++ b/commands/100-games/searchGame.js @@ -10,10 +10,11 @@ module.exports = { const gamename = interaction.options.getString('gamename'); await interaction.reply(`Searching for ${gamename}...`); - let body = `search "${gamename}"; `; - body = await body.concat('fields *; limit 25; where (category = 0 | category = 4) & version_parent = null;'); + let games = await searchGamesWithMinimumReview(gamename); - const games = await getGameJson(body); + if (games.length == 0) games = await searchGamesWithoutMinimumReview(gamename); + + if (games.length == 0) return interaction.followUp('No games found.'); await games.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count));