Skip to content

Commit 6bb03f2

Browse files
authoredDec 21, 2021
fix(StickerPack): Nullify bannerId (#7119)
1 parent 645b3f8 commit 6bb03f2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎src/structures/StickerPack.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ class StickerPack extends Base {
5050

5151
/**
5252
* The id of the sticker pack's banner image
53-
* @type {Snowflake}
53+
* @type {?Snowflake}
5454
*/
55-
this.bannerId = pack.banner_asset_id;
55+
this.bannerId = pack.banner_asset_id ?? null;
5656
}
5757

5858
/**
@@ -85,10 +85,10 @@ class StickerPack extends Base {
8585
/**
8686
* The URL to this sticker pack's banner.
8787
* @param {StaticImageURLOptions} [options={}] Options for the Image URL
88-
* @returns {string}
88+
* @returns {?string}
8989
*/
9090
bannerURL({ format, size } = {}) {
91-
return this.client.rest.cdn.StickerPackBanner(this.bannerId, format, size);
91+
return this.bannerId && this.client.rest.cdn.StickerPackBanner(this.bannerId, format, size);
9292
}
9393
}
9494

‎typings/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2102,15 +2102,15 @@ export class StickerPack extends Base {
21022102
private constructor(client: Client, data: RawStickerPackData);
21032103
public readonly createdTimestamp: number;
21042104
public readonly createdAt: Date;
2105-
public bannerId: Snowflake;
2105+
public bannerId: Snowflake | null;
21062106
public readonly coverSticker: Sticker | null;
21072107
public coverStickerId: Snowflake | null;
21082108
public description: string;
21092109
public id: Snowflake;
21102110
public name: string;
21112111
public skuId: Snowflake;
21122112
public stickers: Collection<Snowflake, Sticker>;
2113-
public bannerURL(options?: StaticImageURLOptions): string;
2113+
public bannerURL(options?: StaticImageURLOptions): string | null;
21142114
}
21152115

21162116
/** @deprecated See [Self-serve Game Selling Deprecation](https://support-dev.discord.com/hc/en-us/articles/4414590563479) for more information */

0 commit comments

Comments
 (0)
Please sign in to comment.