diff --git a/package-lock.json b/package-lock.json index 51d8fb2..4342fc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "axios": "^1.1.3", + "manacube": "^1.2.3", "qs": "^6.11.0" }, "devDependencies": { @@ -2957,6 +2958,15 @@ "tmpl": "1.0.5" } }, + "node_modules/manacube": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/manacube/-/manacube-1.2.3.tgz", + "integrity": "sha512-/xhQAmOuN8JXO8F4uuN90e16NLMEPKSIaqzPVk732d86PzjpmSrxZQ6/Ibko2wlp0HgpNn3IYzkSEaKKWDedvg==", + "dependencies": { + "axios": "^1.1.3", + "qs": "^6.11.0" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -6236,6 +6246,15 @@ "tmpl": "1.0.5" } }, + "manacube": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/manacube/-/manacube-1.2.3.tgz", + "integrity": "sha512-/xhQAmOuN8JXO8F4uuN90e16NLMEPKSIaqzPVk732d86PzjpmSrxZQ6/Ibko2wlp0HgpNn3IYzkSEaKKWDedvg==", + "requires": { + "axios": "^1.1.3", + "qs": "^6.11.0" + } + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", diff --git a/package.json b/package.json index 1ac3d85..88a7926 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "license": "MIT", "dependencies": { "axios": "^1.1.3", + "manacube": "^1.2.3", "qs": "^6.11.0" }, "devDependencies": { diff --git a/src/index.ts b/src/index.ts index 01910aa..99f9532 100644 --- a/src/index.ts +++ b/src/index.ts @@ -220,7 +220,7 @@ class ManaCubeApi { async getPlayerGuild(uuid: string): Promise { 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); } diff --git a/src/types/default.ts b/src/types/default.ts index e96d499..8e78d3c 100644 --- a/src/types/default.ts +++ b/src/types/default.ts @@ -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; @@ -74,7 +82,7 @@ export interface guild { level: number; description: string; homeServer: string; - members: Array; + members: Array; } export interface friend {