Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types(InteractionCollector): Fix guild and channel types #7624

Merged
merged 3 commits into from Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/structures/InteractionCollector.js
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/util/Constants.js
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions typings/index.d.ts
Expand Up @@ -4896,9 +4896,9 @@ export type IntegrationType = 'twitch' | 'youtube' | 'discord';

export interface InteractionCollectorOptions<T extends Interaction, Cached extends CacheType = CacheType>
extends CollectorOptions<[T]> {
channel?: TextBasedChannel;
channel?: TextBasedChannelResolvable;
componentType?: MessageComponentType | MessageComponentTypes;
guild?: Guild;
guild?: GuildResolvable;
interactionType?: InteractionType | InteractionTypes;
max?: number;
maxComponents?: number;
Expand Down Expand Up @@ -5624,6 +5624,8 @@ export type GuildTextBasedChannel = Extract<GuildBasedChannel, TextBasedChannel>

export type TextChannelResolvable = Snowflake | TextChannel;

export type TextBasedChannelResolvable = Snowflake | TextBasedChannel;

export type ThreadAutoArchiveDuration = 60 | 1440 | 4320 | 10080 | 'MAX';

export type ThreadChannelResolvable = ThreadChannel | Snowflake;
Expand Down