Skip to content

Commit

Permalink
fix: Correct guild member banner URL (#10677)
Browse files Browse the repository at this point in the history
fix: correct guild member banner URL

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
Jiralite and kodiakhq[bot] authored Jan 2, 2025
1 parent 65883f3 commit 9fea069
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/rest/__tests__/CDN.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/rest/src/lib/CDN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class CDN {
bannerHash: string,
options?: Readonly<ImageURLOptions>,
): string {
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banner`, bannerHash, options);
return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/banners/${bannerHash}`, bannerHash, options);
}

/**
Expand Down

0 comments on commit 9fea069

Please sign in to comment.