mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
refactor: added TextBasedChannels type (#6286)
This commit is contained in:
@@ -110,8 +110,7 @@ class Channel extends Base {
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this channel is text-based
|
||||
* ({@link TextChannel}, {@link DMChannel}, {@link NewsChannel} or {@link ThreadChannel}).
|
||||
* Indicates whether this channel is {@link TextBasedChannels text-based}.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isText() {
|
||||
|
||||
@@ -17,7 +17,7 @@ class CommandInteraction extends Interaction {
|
||||
|
||||
/**
|
||||
* The channel this interaction was sent in
|
||||
* @type {?(TextChannel|NewsChannel|DMChannel)}
|
||||
* @type {?TextBasedChannels}
|
||||
* @name CommandInteraction#channel
|
||||
* @readonly
|
||||
*/
|
||||
|
||||
@@ -89,7 +89,7 @@ class Interaction extends Base {
|
||||
|
||||
/**
|
||||
* The channel this interaction was sent in
|
||||
* @type {?Channel}
|
||||
* @type {?TextBasedChannels}
|
||||
* @readonly
|
||||
*/
|
||||
get channel() {
|
||||
|
||||
@@ -7,7 +7,7 @@ const { InteractionTypes, MessageComponentTypes } = require('../util/Constants')
|
||||
|
||||
/**
|
||||
* @typedef {CollectorOptions} InteractionCollectorOptions
|
||||
* @property {TextChannel|DMChannel|NewsChannel} [channel] The channel to listen to interactions from
|
||||
* @property {TextBasedChannels} [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 {InteractionType} [interactionType] The type of interaction to listen for
|
||||
@@ -39,7 +39,7 @@ class InteractionCollector extends Collector {
|
||||
|
||||
/**
|
||||
* The channel from which to collect interactions, if provided
|
||||
* @type {?(TextChannel|DMChannel|NewsChannel)}
|
||||
* @type {?TextBasedChannels}
|
||||
*/
|
||||
this.channel = this.message?.channel ?? options.channel ?? null;
|
||||
|
||||
|
||||
@@ -27,14 +27,14 @@ class Message extends Base {
|
||||
/**
|
||||
* @param {Client} client The instantiating client
|
||||
* @param {APIMessage} data The data for the message
|
||||
* @param {TextChannel|DMChannel|NewsChannel|ThreadChannel} channel The channel the message was sent in
|
||||
* @param {TextBasedChannels} channel The channel the message was sent in
|
||||
*/
|
||||
constructor(client, data, channel) {
|
||||
super(client);
|
||||
|
||||
/**
|
||||
* The channel that the message was sent in
|
||||
* @type {TextChannel|DMChannel|NewsChannel|ThreadChannel}
|
||||
* @type {TextBasedChannels}
|
||||
*/
|
||||
this.channel = channel;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ const { Events } = require('../util/Constants');
|
||||
*/
|
||||
class MessageCollector extends Collector {
|
||||
/**
|
||||
* @param {TextChannel|DMChannel} channel The channel
|
||||
* @param {TextBasedChannels} channel The channel
|
||||
* @param {MessageCollectorOptions} options The options to be applied to this collector
|
||||
* @emits MessageCollector#message
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ class MessageCollector extends Collector {
|
||||
|
||||
/**
|
||||
* The channel
|
||||
* @type {TextBasedChannel}
|
||||
* @type {TextBasedChannels}
|
||||
*/
|
||||
this.channel = channel;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ const Base = require('./Base');
|
||||
*/
|
||||
class Typing extends Base {
|
||||
/**
|
||||
* @param {TextChannel|DMChannel|NewsChannel|ThreadChannel} channel The channel this typing came from
|
||||
* @param {TextBasedChannels} channel The channel this typing came from
|
||||
* @param {User} user The user that started typing
|
||||
* @param {APITypingStart} data The raw data received
|
||||
*/
|
||||
@@ -17,7 +17,7 @@ class Typing extends Base {
|
||||
|
||||
/**
|
||||
* The channel the status is from
|
||||
* @type {TextChannel|DMChannel|NewsChannel|ThreadChannel}
|
||||
* @type {TextBasedChannels}
|
||||
*/
|
||||
this.channel = channel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user