From f1e85074ce32f62a7b44d5bd6c8399d99f2368c5 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 31 May 2021 19:38:29 -0500 Subject: add leaderboard infos --- build/database.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'build') diff --git a/build/database.js b/build/database.js index ad386fd..7c7d192 100644 --- a/build/database.js +++ b/build/database.js @@ -54,6 +54,10 @@ let memberLeaderboardsCollection; let profileLeaderboardsCollection; let sessionsCollection; let accountsCollection; +const leaderboardInfos = { + highest_crit_damage: 'This leaderboard is capped at the integer limit because Hypixel, look at Highest critical damage instead.', + highest_critical_damage: 'uhhhhh yeah idk either' +}; async function connect() { if (!process.env.db_uri) return console.warn('Warning: db_uri was not found in .env. Features that utilize the database such as leaderboards won\'t work.'); @@ -313,12 +317,16 @@ exports.fetchProfileLeaderboard = fetchProfileLeaderboard; /** Fetch a leaderboard */ async function fetchLeaderboard(name) { const profileLeaderboards = await fetchAllProfileLeaderboardAttributes(); + let leaderboard; if (profileLeaderboards.includes(name)) { - return await fetchProfileLeaderboard(name); + leaderboard = await fetchProfileLeaderboard(name); } else { - return await fetchMemberLeaderboard(name); + leaderboard = await fetchMemberLeaderboard(name); } + if (leaderboardInfos[name]) + leaderboard.info = leaderboardInfos[name]; + return leaderboard; } exports.fetchLeaderboard = fetchLeaderboard; /** Get the leaderboard positions a member is on. This may take a while depending on whether stuff is cached */ -- cgit