From b383b2059d889050b8d6213fb06f81fb08a4fda2 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Fri, 25 Feb 2022 14:56:48 +0000 Subject: [PATCH 1/2] feat: backport #7452 --- src/structures/InteractionCollector.js | 4 ++-- typings/index.d.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/structures/InteractionCollector.js b/src/structures/InteractionCollector.js index 574c047e2a4f..d7e6134fa991 100644 --- a/src/structures/InteractionCollector.js +++ b/src/structures/InteractionCollector.js @@ -7,9 +7,9 @@ const { InteractionTypes, MessageComponentTypes } = require('../util/Constants') /** * @typedef {CollectorOptions} InteractionCollectorOptions - * @property {TextBasedChannels} [channel] The channel to listen to interactions from + * @property {TextBasedChannelResolvable} [channel] The channel to listen to interactions from * @property {MessageComponentType} [componentType] The type of component to listen for - * @property {Guild} [guild] The guild to listen to interactions from + * @property {GuildResolvable} [guild] The guild to listen to interactions from * @property {InteractionType} [interactionType] The type of interaction to listen for * @property {number} [max] The maximum total amount of interactions to collect * @property {number} [maxComponents] The maximum number of components to collect diff --git a/typings/index.d.ts b/typings/index.d.ts index 89fd1c4a7d1e..6ac9a606d005 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -4883,9 +4883,9 @@ export type IntegrationType = 'twitch' | 'youtube' | 'discord'; export interface InteractionCollectorOptions extends CollectorOptions<[T]> { - channel?: TextBasedChannel; + channel?: TextBasedChannelResolvable; componentType?: MessageComponentType | MessageComponentTypes; - guild?: Guild; + guild?: GuildResolvable; interactionType?: InteractionType | InteractionTypes; max?: number; maxComponents?: number; @@ -5608,6 +5608,8 @@ export type GuildTextBasedChannel = Extract export type TextChannelResolvable = Snowflake | TextChannel; +export type TextBasedChannelResolvable = Snowflake | TextBasedChannel; + export type ThreadAutoArchiveDuration = 60 | 1440 | 4320 | 10080 | 'MAX'; export type ThreadChannelResolvable = ThreadChannel | Snowflake; From 87b9a00dec2fa374f719f3b528fabe097ca10975 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Fri, 25 Feb 2022 15:12:46 +0000 Subject: [PATCH 2/2] fix: backport #7551 --- src/structures/InteractionCollector.js | 2 +- src/util/Constants.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/structures/InteractionCollector.js b/src/structures/InteractionCollector.js index d7e6134fa991..f28173c2a799 100644 --- a/src/structures/InteractionCollector.js +++ b/src/structures/InteractionCollector.js @@ -7,7 +7,7 @@ const { InteractionTypes, MessageComponentTypes } = require('../util/Constants') /** * @typedef {CollectorOptions} InteractionCollectorOptions - * @property {TextBasedChannelResolvable} [channel] The channel to listen to interactions from + * @property {TextBasedChannelsResolvable} [channel] The channel to listen to interactions from * @property {MessageComponentType} [componentType] The type of component to listen for * @property {GuildResolvable} [guild] The guild to listen to interactions from * @property {InteractionType} [interactionType] The type of interaction to listen for diff --git a/src/util/Constants.js b/src/util/Constants.js index 14b0e526c906..4803abfb9549 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -556,6 +556,13 @@ exports.ChannelTypes = createEnum([ * @typedef {DMChannel|TextChannel|NewsChannel|ThreadChannel} TextBasedChannels */ +/** + * Data that resolves to give a text-based channel. This can be: + * * A text-based channel + * * A snowflake + * @typedef {TextBasedChannels|Snowflake} TextBasedChannelsResolvable + */ + /** * The types of channels that are text-based. The available types are: * * DM