From 9fea0698af79fe2bb31e4ba3ff9b921362310c05 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Thu, 2 Jan 2025 08:19:33 +0000 Subject: [PATCH] fix: Correct guild member banner URL (#10677) fix: correct guild member banner URL Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/rest/__tests__/CDN.test.ts | 14 ++++++++++++++ packages/rest/src/lib/CDN.ts | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/rest/__tests__/CDN.test.ts b/packages/rest/__tests__/CDN.test.ts index e590cf3fcfd6..5f787cd0e371 100644 --- a/packages/rest/__tests__/CDN.test.ts +++ b/packages/rest/__tests__/CDN.test.ts @@ -72,6 +72,20 @@ test('guildMemberAvatar dynamic-not-animated', () => { expect(cdn.guildMemberAvatar(id, id, hash)).toEqual(`${baseCDN}/guilds/${id}/users/${id}/avatars/${hash}.webp`); }); +test('guildMemberBanner default', () => { + expect(cdn.guildMemberBanner(id, id, hash)).toEqual(`${baseCDN}/guilds/${id}/users/${id}/banners/${hash}.webp`); +}); + +test('guildMemberBanner dynamic-animated', () => { + expect(cdn.guildMemberBanner(id, id, animatedHash)).toEqual( + `${baseCDN}/guilds/${id}/users/${id}/banners/${animatedHash}.gif`, + ); +}); + +test('guildMemberBanner dynamic-not-animated', () => { + expect(cdn.guildMemberBanner(id, id, hash)).toEqual(`${baseCDN}/guilds/${id}/users/${id}/banners/${hash}.webp`); +}); + test('guildScheduledEventCover default', () => { expect(cdn.guildScheduledEventCover(id, hash)).toEqual(`${baseCDN}/guild-events/${id}/${hash}.webp`); }); diff --git a/packages/rest/src/lib/CDN.ts b/packages/rest/src/lib/CDN.ts index 5b874e26565d..6410e5110ac1 100644 --- a/packages/rest/src/lib/CDN.ts +++ b/packages/rest/src/lib/CDN.ts @@ -198,7 +198,7 @@ export class CDN { bannerHash: string, options?: Readonly, ): string { - return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banner`, bannerHash, options); + return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banners/${bannerHash}`, bannerHash, options); } /**