feat: add support for gif stickers (v13) (#9158)

* update new sticker file type

* update

* lint
This commit is contained in:
Elysia
2023-03-06 05:43:46 +07:00
committed by GitHub
parent 120270e8dc
commit 4bc25c40f5
2 changed files with 6 additions and 2 deletions

View File

@@ -96,7 +96,9 @@ exports.Endpoints = {
makeImageUrl(`${root}/discovery-splashes/${guildId}/${hash}`, { size, format }),
TeamIcon: (teamId, hash, options) => makeImageUrl(`${root}/team-icons/${teamId}/${hash}`, options),
Sticker: (stickerId, stickerFormat) =>
`${root}/stickers/${stickerId}.${stickerFormat === 'LOTTIE' ? 'json' : 'png'}`,
`${root}/stickers/${stickerId}.${
stickerFormat === 'LOTTIE' ? 'json' : stickerFormat === 'GIF' ? 'gif' : 'png'
}`,
RoleIcon: (roleId, hash, format = 'webp', size) =>
makeImageUrl(`${root}/role-icons/${roleId}/${hash}`, { size, format }),
guildScheduledEventCover: (scheduledEventId, coverHash, format, size) =>
@@ -1199,10 +1201,11 @@ exports.StickerTypes = createEnum([null, 'STANDARD', 'GUILD']);
* * PNG
* * APNG
* * LOTTIE
* * GIF
* @typedef {string} StickerFormatType
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types}
*/
exports.StickerFormatTypes = createEnum([null, 'PNG', 'APNG', 'LOTTIE']);
exports.StickerFormatTypes = createEnum([null, 'PNG', 'APNG', 'LOTTIE', 'GIF']);
/**
* An overwrite type:

1
typings/enums.d.ts vendored
View File

@@ -223,6 +223,7 @@ export const enum StickerFormatTypes {
PNG = 1,
APNG = 2,
LOTTIE = 3,
GIF = 4,
}
export const enum StickerTypes {