-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ResourceManager.ts
74 lines (66 loc) · 1.62 KB
/
ResourceManager.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { BaseManager } from './BaseManager';
import type { Client } from '../Client';
import type {
VanityPetsResponse,
AchievementsResponse,
ChallengesResponse,
GameInformationResponse,
GuildAchievementsResponse,
QuestsResponse,
VanityCompanionsResponse
} from '../typings';
/**
* Resource endpoints.
*
* **Note**: API Key authorization is not required to use this manager.
*
* @category Managers
* @group Managers
*/
export class ResourceManager extends BaseManager {
public constructor(client: Client) {
super(client, false);
}
/**
* Fetch information about Hypixel games
*/
public async fetchGameInformation() {
return this.makeGetRequest<GameInformationResponse>('/resources/games');
}
/**
* Fetch all achievements
*/
public async fetchAchievements() {
return this.makeGetRequest<AchievementsResponse>('/resources/achievements');
}
/**
* Fetch all challenges
*/
public async fetchChallenges() {
return this.makeGetRequest<ChallengesResponse>('/resources/challenges');
}
/**
* Fetch all quests
*/
public async fetchQuests() {
return this.makeGetRequest<QuestsResponse>('/resources/quests');
}
/**
* Fetch all guild achievements
*/
public async fetchGuildAchievements() {
return this.makeGetRequest<GuildAchievementsResponse>('/resources/guilds/achievements');
}
/**
* Fetch all vanity pets
*/
public async fetchVanityPets() {
return this.makeGetRequest<VanityPetsResponse>('/resources/vanity/pets');
}
/**
* Fetch all vanity companions
*/
public async fetchVanityCompanions() {
return this.makeGetRequest<VanityCompanionsResponse>('/resources/vanity/companions');
}
}