mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 21:13:30 +01:00
refactor(InteractionCollector): simplify constructor logic (#7667)
* refactor(InteractionCollector): simplify constructor logic * fix: oversight
This commit is contained in:
@@ -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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user