refactor(InteractionCollector): simplify constructor logic (#7667)

* refactor(InteractionCollector): simplify constructor logic

* fix: oversight
This commit is contained in:
muchnameless
2022-03-24 21:00:30 +01:00
committed by GitHub
parent 0c32332a5a
commit 07b23a99c7

View File

@@ -45,16 +45,14 @@ class InteractionCollector extends Collector {
* @type {?Snowflake} * @type {?Snowflake}
*/ */
this.channelId = this.channelId =
this.client.channels.resolveId(options.message?.channel) ?? options.message?.channelId ?? options.message?.channel_id ?? this.client.channels.resolveId(options.channel);
options.message?.channel_id ??
this.client.channels.resolveId(options.channel);
/** /**
* The guild from which to collect interactions, if provided * The guild from which to collect interactions, if provided
* @type {?Snowflake} * @type {?Snowflake}
*/ */
this.guildId = this.guildId =
this.client.guilds.resolveId(options.message?.guild) ?? options.message?.guildId ??
options.message?.guild_id ?? options.message?.guild_id ??
this.client.guilds.resolveId(options.channel?.guild) ?? this.client.guilds.resolveId(options.channel?.guild) ??
this.client.guilds.resolveId(options.guild); this.client.guilds.resolveId(options.guild);
@@ -83,7 +81,6 @@ class InteractionCollector extends Collector {
*/ */
this.total = 0; this.total = 0;
this.empty = this.empty.bind(this);
this.client.incrementMaxListeners(); this.client.incrementMaxListeners();
const bulkDeleteListener = messages => { const bulkDeleteListener = messages => {