diff --git a/src/structures/StickerPack.js b/src/structures/StickerPack.js index 62f7f1aaf288..6fd6a5b74439 100644 --- a/src/structures/StickerPack.js +++ b/src/structures/StickerPack.js @@ -50,9 +50,9 @@ class StickerPack extends Base { /** * The id of the sticker pack's banner image - * @type {Snowflake} + * @type {?Snowflake} */ - this.bannerId = pack.banner_asset_id; + this.bannerId = pack.banner_asset_id ?? null; } /** @@ -85,10 +85,10 @@ class StickerPack extends Base { /** * The URL to this sticker pack's banner. * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {string} + * @returns {?string} */ bannerURL({ format, size } = {}) { - return this.client.rest.cdn.StickerPackBanner(this.bannerId, format, size); + return this.bannerId && this.client.rest.cdn.StickerPackBanner(this.bannerId, format, size); } } diff --git a/typings/index.d.ts b/typings/index.d.ts index 61306cd3b3c6..e0eaa6a3aca4 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2102,7 +2102,7 @@ export class StickerPack extends Base { private constructor(client: Client, data: RawStickerPackData); public readonly createdTimestamp: number; public readonly createdAt: Date; - public bannerId: Snowflake; + public bannerId: Snowflake | null; public readonly coverSticker: Sticker | null; public coverStickerId: Snowflake | null; public description: string; @@ -2110,7 +2110,7 @@ export class StickerPack extends Base { public name: string; public skuId: Snowflake; public stickers: Collection; - public bannerURL(options?: StaticImageURLOptions): string; + public bannerURL(options?: StaticImageURLOptions): string | null; } /** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information */