From 78140748ce4a64977426a93fd72c9e2783e5919d Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Thu, 10 Mar 2022 08:00:58 +0000 Subject: [PATCH] types(InteractionCollector): Fix guild and channel types (#7624) --- src/structures/InteractionCollector.js | 4 ++-- src/util/Constants.js | 7 +++++++ typings/index.d.ts | 6 ++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/structures/InteractionCollector.js b/src/structures/InteractionCollector.js index 574c047e2a4f..f28173c2a799 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 {TextBasedChannelsResolvable} [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/src/util/Constants.js b/src/util/Constants.js index c09af5d23928..f9464442b14e 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -558,6 +558,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 diff --git a/typings/index.d.ts b/typings/index.d.ts index 9ce2bb730a6f..de4e3f486586 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -4896,9 +4896,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; @@ -5624,6 +5624,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;