Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(StickerPack): Nullify bannerId #7119

Merged
merged 2 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/structures/StickerPack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2096,15 +2096,15 @@ 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;
public id: Snowflake;
public name: string;
public skuId: Snowflake;
public stickers: Collection<Snowflake, Sticker>;
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 */
Expand Down