From 2406b502700816b25dc94c7fe246006aa434320f Mon Sep 17 00:00:00 2001 From: baz Date: Tue, 28 Nov 2023 22:05:29 +0000 Subject: [PATCH] Create searchGamesWithMinimumReviews function --- commands/100-games/searchGame.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/100-games/searchGame.js b/commands/100-games/searchGame.js index fa8bee4..90df6b3 100644 --- a/commands/100-games/searchGame.js +++ b/commands/100-games/searchGame.js @@ -37,6 +37,15 @@ module.exports = { }, }; +async function searchGamesWithMinimumReview(gamename) { + let body = `search "${gamename}"; `; + body = await body.concat('fields *; limit 25; where (category = 0 | category = 4) & version_parent = null & total_rating_count > 0;'); + + const games = await getGameJson(body); + + return games; +} + async function getGameJson(body) { let res;