Filter games more

This commit is contained in:
baz 2024-02-14 19:48:39 +00:00
parent b3f78a3f25
commit fb5c3fdddd
3 changed files with 9 additions and 3 deletions

View File

@ -34,7 +34,9 @@ module.exports = {
body = body.concat('fields *;');
const res = await getGameJson(body);
let res = await getGameJson(body);
res = res.filter(entry => entry.status !== 6);
res.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count));
if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true });

View File

@ -31,7 +31,9 @@ module.exports = {
body = body.concat('fields *;');
const res = await getGameJson(body);
let res = await getGameJson(body);
res = res.filter(entry => entry.status !== 6);
res.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count));
if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true });

View File

@ -31,7 +31,9 @@ module.exports = {
body = body.concat('fields *;');
const res = await getGameJson(body);
let res = await getGameJson(body);
res = res.filter(entry => entry.status !== 6);
res.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count));
if (!res[0]) return interaction.followUp({ content: 'No game found for the options supplied.', ephemeral: true });