mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
docs: fix some missed MessageComponent collector methods (#6023)
This commit is contained in:
@@ -91,8 +91,8 @@ class DMChannel extends Channel {
|
|||||||
get typingCount() {}
|
get typingCount() {}
|
||||||
createMessageCollector() {}
|
createMessageCollector() {}
|
||||||
awaitMessages() {}
|
awaitMessages() {}
|
||||||
createMessageComponentInteractionCollector() {}
|
createMessageComponentCollector() {}
|
||||||
awaitMessageComponentInteraction() {}
|
awaitMessageComponent() {}
|
||||||
// Doesn't work on DM channels; bulkDelete() {}
|
// Doesn't work on DM channels; bulkDelete() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const { InteractionTypes, MessageComponentTypes } = require('../util/Constants')
|
|||||||
*/
|
*/
|
||||||
class InteractionCollector extends Collector {
|
class InteractionCollector extends Collector {
|
||||||
/**
|
/**
|
||||||
* @param {Client} client The client on which to collect message component interactions
|
* @param {Client} client The client on which to collect interactions
|
||||||
* @param {InteractionCollectorOptions} [options={}] The options to apply to this collector
|
* @param {InteractionCollectorOptions} [options={}] The options to apply to this collector
|
||||||
*/
|
*/
|
||||||
constructor(client, options = {}) {
|
constructor(client, options = {}) {
|
||||||
@@ -68,7 +68,7 @@ class InteractionCollector extends Collector {
|
|||||||
: options.componentType ?? null;
|
: options.componentType ?? null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The users which have interacted to components on this collector
|
* The users which have interacted to this collector
|
||||||
* @type {Collection}
|
* @type {Collection}
|
||||||
*/
|
*/
|
||||||
this.users = new Collection();
|
this.users = new Collection();
|
||||||
@@ -122,7 +122,7 @@ class InteractionCollector extends Collector {
|
|||||||
collect(interaction) {
|
collect(interaction) {
|
||||||
/**
|
/**
|
||||||
* Emitted whenever a interaction is collected.
|
* Emitted whenever a interaction is collected.
|
||||||
* @event MessageComponentInteractionCollector#collect
|
* @event InteractionCollector#collect
|
||||||
* @param {Interaction} interaction The interaction that was collected
|
* @param {Interaction} interaction The interaction that was collected
|
||||||
*/
|
*/
|
||||||
if (this.interactionType && interaction.type !== this.interactionType) return null;
|
if (this.interactionType && interaction.type !== this.interactionType) return null;
|
||||||
@@ -142,7 +142,7 @@ class InteractionCollector extends Collector {
|
|||||||
dispose(interaction) {
|
dispose(interaction) {
|
||||||
/**
|
/**
|
||||||
* Emitted whenever an interaction is disposed of.
|
* Emitted whenever an interaction is disposed of.
|
||||||
* @event MessageComponentInteractionCollector#dispose
|
* @event InteractionCollector#dispose
|
||||||
* @param {Interaction} interaction The interaction that was disposed of
|
* @param {Interaction} interaction The interaction that was disposed of
|
||||||
*/
|
*/
|
||||||
if (this.type && interaction.type !== this.type) return null;
|
if (this.type && interaction.type !== this.type) return null;
|
||||||
@@ -155,7 +155,7 @@ class InteractionCollector extends Collector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Empties this message component collector.
|
* Empties this interaction collector.
|
||||||
*/
|
*/
|
||||||
empty() {
|
empty() {
|
||||||
this.total = 0;
|
this.total = 0;
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ class Message extends Base {
|
|||||||
* @example
|
* @example
|
||||||
* // Create a message component interaction collector
|
* // Create a message component interaction collector
|
||||||
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
||||||
* const collector = message.createMessageComponentInteractionCollector({ filter, time: 15000 });
|
* const collector = message.createMessageComponentCollector({ filter, time: 15000 });
|
||||||
* collector.on('collect', i => console.log(`Collected ${i.customID}`));
|
* collector.on('collect', i => console.log(`Collected ${i.customID}`));
|
||||||
* collector.on('end', collected => console.log(`Collected ${collected.size} items`));
|
* collector.on('end', collected => console.log(`Collected ${collected.size} items`));
|
||||||
*/
|
*/
|
||||||
@@ -482,7 +482,7 @@ class Message extends Base {
|
|||||||
* @example
|
* @example
|
||||||
* // Collect a message component interaction
|
* // Collect a message component interaction
|
||||||
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
||||||
* message.awaitMessageComponentInteraction({ filter, time: 15000 })
|
* message.awaitMessageComponent({ filter, time: 15000 })
|
||||||
* .then(interaction => console.log(`${interaction.customID} was clicked!`))
|
* .then(interaction => console.log(`${interaction.customID} was clicked!`))
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -198,8 +198,8 @@ class TextChannel extends GuildChannel {
|
|||||||
get typingCount() {}
|
get typingCount() {}
|
||||||
createMessageCollector() {}
|
createMessageCollector() {}
|
||||||
awaitMessages() {}
|
awaitMessages() {}
|
||||||
createMessageComponentInteractionCollector() {}
|
createMessageComponentCollector() {}
|
||||||
awaitMessageComponentInteraction() {}
|
awaitMessageComponent() {}
|
||||||
bulkDelete() {}
|
bulkDelete() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -405,8 +405,8 @@ class ThreadChannel extends Channel {
|
|||||||
get typingCount() {}
|
get typingCount() {}
|
||||||
createMessageCollector() {}
|
createMessageCollector() {}
|
||||||
awaitMessages() {}
|
awaitMessages() {}
|
||||||
createMessageComponentInteractionCollector() {}
|
createMessageComponentCollector() {}
|
||||||
awaitMessageComponentInteractions() {}
|
awaitMessageComponent() {}
|
||||||
bulkDelete() {}
|
bulkDelete() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ class TextBasedChannel {
|
|||||||
* @example
|
* @example
|
||||||
* // Create a button interaction collector
|
* // Create a button interaction collector
|
||||||
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
||||||
* const collector = channel.createMessageComponentInteractionCollector({ filter, time: 15000 });
|
* const collector = channel.createMessageComponentCollector({ filter, time: 15000 });
|
||||||
* collector.on('collect', i => console.log(`Collected ${i.customID}`));
|
* collector.on('collect', i => console.log(`Collected ${i.customID}`));
|
||||||
* collector.on('end', collected => console.log(`Collected ${collected.size} items`));
|
* collector.on('end', collected => console.log(`Collected ${collected.size} items`));
|
||||||
*/
|
*/
|
||||||
@@ -330,7 +330,7 @@ class TextBasedChannel {
|
|||||||
* @example
|
* @example
|
||||||
* // Collect a message component interaction
|
* // Collect a message component interaction
|
||||||
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
* const filter = (interaction) => interaction.customID === 'button' && interaction.user.id === 'someID';
|
||||||
* channel.awaitMessageComponentInteraction({ filter, time: 15000 })
|
* channel.awaitMessageComponent({ filter, time: 15000 })
|
||||||
* .then(interaction => console.log(`${interaction.customID} was clicked!`))
|
* .then(interaction => console.log(`${interaction.customID} was clicked!`))
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user