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

Commit 9d9d5a1

Browse files
committed
add games information route
1 parent ec90f30 commit 9d9d5a1

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
SkyBlockProfilesResponse,
2121
SkyBlockSkillsResponse,
2222
RankedSkywarsResponse,
23+
GamesInformationResponse,
2324
} from './responses/index'
2425

2526

@@ -66,6 +67,10 @@ export interface Requests {
6667
options: {}
6768
response: Response<SkyBlockElectionResponse>
6869
}
70+
'resources/games': {
71+
options: {}
72+
response: Response<GamesInformationResponse>
73+
}
6974
'skyblock/profiles': {
7075
options: {
7176
uuid: string

src/responses/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export * from './resources/skyblock/collections'
22
export * from './resources/skyblock/election'
33
export * from './resources/skyblock/skills'
44
export * from './resources/skyblock/items'
5+
export * from './resources/games'
56

67
export * from './skyblock/_profile_member'
78
export * from './skyblock/_profile'

src/responses/resources/games.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export interface GamesInformationResponse {
2+
success: true
3+
lastUpdated: number
4+
games: {
5+
/** The ID of the game or mode, for example `SKYBLOCK`, `GINGERBREAD`, `DUELS`. */
6+
[key: string]: {
7+
/**
8+
* A record of mode IDs to display names. The IDs may or may not be
9+
* capitalized, but they will be snake cased.
10+
*/
11+
modeNames?: Record<string, string>
12+
/**
13+
* Whether the game is in the classic games lobby. Note that not
14+
* all classic games have the legacy field.
15+
*/
16+
legacy?: true
17+
/** The display name of the game in the database */
18+
databaseName: string
19+
/** The actual correct display name of the game */
20+
name: string
21+
/** The numeric id of the game */
22+
id: number
23+
/** Whether the game no longer exists */
24+
retired?: boolean
25+
}
26+
}
27+
}

test/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,7 @@ console.log('ok doing tsc');
6868
uuid: 'a91bd7ca5d4b4846990bf4393727f279'
6969
}, true))
7070

71+
await testData('GamesInformationResponse', await request('resources/games', {}, true))
72+
7173
console.log('Everything passed :)')
7274
})()

0 commit comments

Comments
 (0)