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

Commit ec90f30

Browse files
committed
Add ranked skywars data
1 parent f007760 commit ec90f30

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
SkyBlockProfileResponse,
2020
SkyBlockProfilesResponse,
2121
SkyBlockSkillsResponse,
22+
RankedSkywarsResponse,
2223
} from './responses/index'
2324

2425

@@ -119,6 +120,13 @@ export interface Requests {
119120
)
120121
response: Response<GuildResponse | MissingFieldResponse | InvalidApiKeyResponse | MalformedUuidResponse | ThrottleResponse>
121122
}
123+
'player/ranked/skywars': {
124+
options: {
125+
uuid: string
126+
key: string
127+
}
128+
response: Response<RankedSkywarsResponse | MissingFieldResponse | InvalidApiKeyResponse | MalformedUuidResponse | ThrottleResponse>
129+
}
122130
}
123131

124132
async function fetchJsonWithRetry(url: string, options: RequestInit) {

src/responses/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ export * from './skyblock/_profile'
88
export * from './skyblock/profiles'
99
export * from './skyblock/profile'
1010

11+
export * from './player/ranked/skywars'
12+
export * from './player'
13+
1114
export * from './recentgames'
1215
export * from './friends'
1316
export * from './status'
14-
export * from './player'
1517
export * from './error'
1618
export * from './guild'
1719
export * from './api'
20+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export interface RankedSkywarsResponse {
2+
success: true
3+
result: {
4+
/** MM_YY, I think */
5+
key: `${number}_${number}`
6+
/** The leaderboard position the player is in */
7+
position: number
8+
/** The player's ranked SkyWars score */
9+
score: number
10+
}
11+
}

test/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,10 @@ console.log('ok doing tsc');
6363
name: 'SkyComm'
6464
}, true))
6565

66+
await testData('RankedSkywarsResponse', await request('player/ranked/skywars', {
67+
key: process.env.API_KEY,
68+
uuid: 'a91bd7ca5d4b4846990bf4393727f279'
69+
}, true))
70+
6671
console.log('Everything passed :)')
6772
})()

test/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
"strict": true,
1010
"skipLibCheck": true
1111
},
12-
"include": ["_test_data.ts"],
13-
"extends": "../tsconfig.json",
12+
"include": ["_test_data.ts"]
1413
}

0 commit comments

Comments
 (0)