From 5fbcb9a9f334ff93bca052e0f36012a1b685b2c0 Mon Sep 17 00:00:00 2001 From: Tyowk Date: Thu, 4 Jul 2024 00:05:09 +0700 Subject: [PATCH] fix: rawLeaderboard.js fixed variable filters that should only display the name of a given variable, and not all variables --- src/functions/rawLeaderboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions/rawLeaderboard.js b/src/functions/rawLeaderboard.js index 19a8fb576..50f604e56 100644 --- a/src/functions/rawLeaderboard.js +++ b/src/functions/rawLeaderboard.js @@ -19,7 +19,7 @@ module.exports = async (d) => { let y = 0; let value; let content = []; - let all = await d.client.db.findMany(table, (data) => data.key.startsWith(variable.deleteBrackets() + "_") && data.key.split("_").length === type === "user" ? 3 : 2); + let all = await d.client.db.findMany(table, (data) => data.key.startsWith(variable.deleteBrackets() + "_") && data.key.split("_").length === (type === "user" ? 3 : 2)); all = all.filter((x, i, y) => y.findIndex(e => e.key === x.key) === i); all = all.sort((x, y) => { return Number(y.value) - Number(x.value)}); @@ -109,4 +109,4 @@ module.exports = async (d) => { return { code: d.util.setCode(data), }; -}; \ No newline at end of file +};