docs(BaseGuildEmoji): account for optional properties (#4723)

This commit is contained in:
Louis
2020-08-28 21:49:53 +09:30
committed by GitHub
parent 6aab9c3d64
commit a363b90fa5
2 changed files with 6 additions and 6 deletions

View File

@@ -32,21 +32,21 @@ class BaseGuildEmoji extends Emoji {
/** /**
* Whether or not this emoji requires colons surrounding it * Whether or not this emoji requires colons surrounding it
* @type {boolean} * @type {?boolean}
* @name GuildEmoji#requiresColons * @name GuildEmoji#requiresColons
*/ */
if (typeof data.require_colons !== 'undefined') this.requiresColons = data.require_colons; if (typeof data.require_colons !== 'undefined') this.requiresColons = data.require_colons;
/** /**
* Whether this emoji is managed by an external service * Whether this emoji is managed by an external service
* @type {boolean} * @type {?boolean}
* @name GuildEmoji#managed * @name GuildEmoji#managed
*/ */
if (typeof data.managed !== 'undefined') this.managed = data.managed; if (typeof data.managed !== 'undefined') this.managed = data.managed;
/** /**
* Whether this emoji is available * Whether this emoji is available
* @type {boolean} * @type {?boolean}
* @name GuildEmoji#available * @name GuildEmoji#available
*/ */
if (typeof data.available !== 'undefined') this.available = data.available; if (typeof data.available !== 'undefined') this.available = data.available;

6
typings/index.d.ts vendored
View File

@@ -114,13 +114,13 @@ declare module 'discord.js' {
constructor(client: Client, data: object, guild: Guild); constructor(client: Client, data: object, guild: Guild);
private _roles: string[]; private _roles: string[];
public available: boolean; public available?: boolean;
public readonly createdAt: Date; public readonly createdAt: Date;
public readonly createdTimestamp: number; public readonly createdTimestamp: number;
public guild: Guild | GuildPreview; public guild: Guild | GuildPreview;
public id: Snowflake; public id: Snowflake;
public managed: boolean; public managed?: boolean;
public requiresColons: boolean; public requiresColons?: boolean;
} }
class BroadcastDispatcher extends VolumeMixin(StreamDispatcher) { class BroadcastDispatcher extends VolumeMixin(StreamDispatcher) {