aboutsummaryrefslogtreecommitdiff
path: root/build/hypixel.js
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-04-27 20:02:26 -0500
committerGitHub <noreply@github.com>2021-04-27 20:02:26 -0500
commit39210646284cabc89256466646f8ea7834a78d31 (patch)
treee602e871a72681038e652907fefecf94ef82702f /build/hypixel.js
parent2b309975eec24b09dab95076c433e9392dc2e3ed (diff)
downloadskyblock-api-39210646284cabc89256466646f8ea7834a78d31.tar.gz
skyblock-api-39210646284cabc89256466646f8ea7834a78d31.tar.bz2
skyblock-api-39210646284cabc89256466646f8ea7834a78d31.zip
Add minion_count leaderboard (#15)
* add minion count leaderboard * fix error that happens sometimes * Update index.js
Diffstat (limited to 'build/hypixel.js')
-rw-r--r--build/hypixel.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/build/hypixel.js b/build/hypixel.js
index 175ee79..9e9007e 100644
--- a/build/hypixel.js
+++ b/build/hypixel.js
@@ -22,7 +22,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
-exports.fetchMemberProfilesUncached = exports.fetchMemberProfileUncached = exports.fetchMemberProfile = exports.fetchUser = exports.sendCleanApiRequest = exports.maxMinion = exports.saveInterval = void 0;
+exports.fetchMemberProfilesUncached = exports.fetchBasicProfileFromUuidUncached = exports.fetchMemberProfileUncached = exports.fetchMemberProfile = exports.fetchUser = exports.sendCleanApiRequest = exports.maxMinion = exports.saveInterval = void 0;
const player_1 = require("./cleaners/player");
const hypixelApi_1 = require("./hypixelApi");
const cached = __importStar(require("./hypixelCached"));
@@ -159,9 +159,23 @@ async function fetchMemberProfileUncached(playerUuid, profileUuid) {
// queue updating the leaderboard positions for the member, eventually
for (const member of profile.members)
database_1.queueUpdateDatabaseMember(member, profile);
+ database_1.queueUpdateDatabaseProfile(profile);
return profile;
}
exports.fetchMemberProfileUncached = fetchMemberProfileUncached;
+/**
+ * Fetches the Hypixel API to get a CleanProfile from its id. This doesn't do any caching and you should use hypixelCached.fetchBasicProfileFromUuid instead
+ * @param playerUuid The UUID of the Minecraft player
+ * @param profileUuid The UUID of the Hypixel SkyBlock profile
+ */
+async function fetchBasicProfileFromUuidUncached(profileUuid) {
+ const profile = await sendCleanApiRequest({
+ path: 'skyblock/profile',
+ args: { profile: profileUuid }
+ }, null, { basic: true });
+ return profile;
+}
+exports.fetchBasicProfileFromUuidUncached = fetchBasicProfileFromUuidUncached;
async function fetchMemberProfilesUncached(playerUuid) {
const profiles = await sendCleanApiRequest({
path: 'skyblock/profiles',
@@ -176,6 +190,7 @@ async function fetchMemberProfilesUncached(playerUuid) {
for (const member of profile.members) {
database_1.queueUpdateDatabaseMember(member, profile);
}
+ database_1.queueUpdateDatabaseProfile(profile);
}
return profiles;
}