From 07b23a99c7088a7c740f23051f3f755f091519b0 Mon Sep 17 00:00:00 2001 From: muchnameless <12682826+muchnameless@users.noreply.github.com> Date: Thu, 24 Mar 2022 21:00:30 +0100 Subject: [PATCH] refactor(InteractionCollector): simplify constructor logic (#7667) * refactor(InteractionCollector): simplify constructor logic * fix: oversight --- packages/discord.js/src/structures/InteractionCollector.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/discord.js/src/structures/InteractionCollector.js b/packages/discord.js/src/structures/InteractionCollector.js index 2b61b6347..400b0c2f6 100644 --- a/packages/discord.js/src/structures/InteractionCollector.js +++ b/packages/discord.js/src/structures/InteractionCollector.js @@ -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); @@ -83,7 +81,6 @@ class InteractionCollector extends Collector { */ this.total = 0; - this.empty = this.empty.bind(this); this.client.incrementMaxListeners(); const bulkDeleteListener = messages => {