Skip to content

Commit

Permalink
feat: fixed the guilds/player endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nick22985 committed Dec 16, 2022
1 parent 453521c commit 89d6048
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"license": "MIT",
"dependencies": {
"axios": "^1.1.3",
"manacube": "^1.2.3",
"qs": "^6.11.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class ManaCubeApi {
async getPlayerGuild(uuid: string): Promise<guild> {
if (!uuid) throw new Error('uuid is required');
return this.axiosConfig
.get(`guilds/${this.safe_uuid(uuid)}`)
.get(`guilds/player/${this.safe_uuid(uuid)}`)
.then((response: { data: any }) => response.data)
.catch((e: any) => e);
}
Expand Down
10 changes: 9 additions & 1 deletion src/types/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ export interface economyVolumeHistory {
periodMS: number;
}

export interface guildPlayer {
uuid: string;
name: string;
guildId: number;
joinDate: string;
rank: number;
}

export interface guild {
id: number;
tag: string;
Expand All @@ -74,7 +82,7 @@ export interface guild {
level: number;
description: string;
homeServer: string;
members: Array<any>;
members: Array<guildPlayer>;
}

export interface friend {
Expand Down

0 comments on commit 89d6048

Please sign in to comment.