Skip to content

Commit

Permalink
refactor(InteractionCollector): simplify constructor logic (#7667)
Browse files Browse the repository at this point in the history
* refactor(InteractionCollector): simplify constructor logic

* fix: oversight
  • Loading branch information
muchnameless authored Mar 24, 2022
1 parent 0c32332 commit 07b23a9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/discord.js/src/structures/InteractionCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ class InteractionCollector extends Collector {
* @type {?Snowflake}
*/
this.channelId =
this.client.channels.resolveId(options.message?.channel) ??
options.message?.channel_id ??
this.client.channels.resolveId(options.channel);
options.message?.channelId ?? options.message?.channel_id ?? this.client.channels.resolveId(options.channel);

/**
* The guild from which to collect interactions, if provided
* @type {?Snowflake}
*/
this.guildId =
this.client.guilds.resolveId(options.message?.guild) ??
options.message?.guildId ??
options.message?.guild_id ??
this.client.guilds.resolveId(options.channel?.guild) ??
this.client.guilds.resolveId(options.guild);
Expand Down Expand Up @@ -83,7 +81,6 @@ class InteractionCollector extends Collector {
*/
this.total = 0;

this.empty = this.empty.bind(this);
this.client.incrementMaxListeners();

const bulkDeleteListener = messages => {
Expand Down

0 comments on commit 07b23a9

Please sign in to comment.