Skip to content

Commit

Permalink
fix(Constants): fix CDN endpoint typings (#6332)
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 committed Aug 8, 2021
1 parent f13d27c commit 47d2ef3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/util/Constants.js
Expand Up @@ -55,10 +55,10 @@ exports.Endpoints = {
if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;
return makeImageUrl(`${root}/icons/${guildId}/${hash}`, { format, size });
},
AppIcon: (clientId, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-icons/${clientId}/${hash}`, { size, format }),
AppAsset: (clientId, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-assets/${clientId}/${hash}`, { size, format }),
AppIcon: (appId, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-icons/${appId}/${hash}`, { size, format }),
AppAsset: (appId, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-assets/${appId}/${hash}`, { size, format }),
StickerPackBanner: (bannerId, format = 'webp', size) =>
makeImageUrl(`${root}/app-assets/710982414301790216/store/${bannerId}`, { size, format }),
GDMIcon: (channelId, hash, format = 'webp', size) =>
Expand Down
45 changes: 27 additions & 18 deletions typings/index.d.ts
Expand Up @@ -2141,33 +2141,42 @@ export const Constants: {
botGateway: string;
invite: (root: string, code: string) => string;
CDN: (root: string) => {
Asset: (name: string) => string;
DefaultAvatar: (id: Snowflake | number) => string;
Emoji: (emojiId: Snowflake, format: DynamicImageFormat) => string;
Avatar: (userId: Snowflake, hash: string, format: DynamicImageFormat, size: AllowedImageSize) => string;
Banner: (guildId: Snowflake | number, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
Icon: (userId: Snowflake | number, hash: string, format: DynamicImageFormat, size: AllowedImageSize) => string;
AppIcon: (userId: Snowflake | number, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
AppAsset: (
userId: Snowflake | number,
Asset: (name: string) => string;
DefaultAvatar: (discriminator: number) => string;
Avatar: (
userId: Snowflake,
hash: string,
format: AllowedImageFormat,
format: DynamicImageFormat,
size: AllowedImageSize,
dynamic: boolean,
) => string;
StickerPackBanner: (bannerId: Snowflake, format: AllowedImageFormat, size: AllowedImageSize) => string;
GDMIcon: (userId: Snowflake | number, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
Splash: (guildId: Snowflake | number, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
DiscoverySplash: (
guildId: Snowflake | number,
Banner: (guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
Icon: (
guildId: Snowflake,
hash: string,
format: AllowedImageFormat,
format: DynamicImageFormat,
size: AllowedImageSize,
dynamic: boolean,
) => string;
AppIcon: (
appId: Snowflake,
hash: string,
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
) => string;
AppAsset: (
appId: Snowflake,
hash: string,
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
) => string;
StickerPackBanner: (bannerId: Snowflake, format: AllowedImageFormat, size: AllowedImageSize) => string;
GDMIcon: (channelId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
Splash: (guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
DiscoverySplash: (guildId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
TeamIcon: (
teamId: Snowflake | number,
teamId: Snowflake,
hash: string,
format: AllowedImageFormat,
size: AllowedImageSize,
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
) => string;
Sticker: (stickerId: Snowflake, stickerFormat: StickerFormatType) => string;
};
Expand Down

0 comments on commit 47d2ef3

Please sign in to comment.