Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Commit

Permalink
add resources/skyblock/election
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Mar 25, 2022
1 parent 76fea4a commit 0dcc056
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { fetch } from 'undici'
import { FriendsResponse } from './responses/friends'
import { RecentGamesResponse } from './responses/recentgames'
import { OnlineStatusResponse } from './responses/status'
import { SkyBlockElectionResponse } from './responses/resources/skyblock/election'

/** The base url of the Hypixel API with a trailing slash */
const BASE_URL = 'https://api.hypixel.net/'
Expand All @@ -32,6 +33,8 @@ async function request(path: 'player', options: {
async function request(path: 'resources/skyblock/collections'): Promise<Response<SkyBlockCollectionsResponse>>
async function request(path: 'resources/skyblock/skills'): Promise<Response<SkyBlockSkillsResponse>>
async function request(path: 'resources/skyblock/items'): Promise<Response<SkyBlockItemsResponse>>
async function request(path: 'resources/skyblock/election'): Promise<Response<SkyBlockElectionResponse>>

async function request(path: 'skyblock/profiles', options: {
uuid: string
key: string
Expand Down Expand Up @@ -83,5 +86,3 @@ async function request(path: string, options?: Record<string, string>): Promise<
}

export { request }

request('player', { key: '1', uuid: 'a' }).then(r => r.data.success ? r.data.player.levelingReward_9999 : {})

0 comments on commit 0dcc056

Please sign in to comment.