Discord.js v13.7

This commit is contained in:
March 7th
2022-05-14 15:06:15 +07:00
parent fc7f02e85b
commit c201e7da69
83 changed files with 4232 additions and 1162 deletions

View File

@@ -6,6 +6,7 @@ const AutocompleteInteraction = require('../../structures/AutocompleteInteractio
const ButtonInteraction = require('../../structures/ButtonInteraction');
const CommandInteraction = require('../../structures/CommandInteraction');
const MessageContextMenuInteraction = require('../../structures/MessageContextMenuInteraction');
const ModalSubmitInteraction = require('../../structures/ModalSubmitInteraction');
const SelectMenuInteraction = require('../../structures/SelectMenuInteraction');
const UserContextMenuInteraction = require('../../structures/UserContextMenuInteraction');
const { Events, InteractionTypes, MessageComponentTypes, ApplicationCommandTypes } = require('../../util/Constants');
@@ -17,8 +18,8 @@ class InteractionCreateAction extends Action {
const client = this.client;
// Resolve and cache partial channels for Interaction#channel getter
this.getChannel(data);
const channel = this.getChannel(data);
// Do not emit this for interactions that cache messages that are non-text-based.
let InteractionType;
switch (data.type) {
case InteractionTypes.APPLICATION_COMMAND:
@@ -41,6 +42,7 @@ class InteractionCreateAction extends Action {
}
break;
case InteractionTypes.MESSAGE_COMPONENT:
if (channel && !channel.isText()) return;
switch (data.data.component_type) {
case MessageComponentTypes.BUTTON:
InteractionType = ButtonInteraction;
@@ -59,6 +61,9 @@ class InteractionCreateAction extends Action {
case InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE:
InteractionType = AutocompleteInteraction;
break;
case InteractionTypes.MODAL_SUBMIT:
InteractionType = ModalSubmitInteraction;
break;
default:
client.emit(
Events.DEBUG,

View File

@@ -13,8 +13,9 @@ class ThreadCreateAction extends Action {
* Emitted whenever a thread is created or when the client user is added to a thread.
* @event Client#threadCreate
* @param {ThreadChannel} thread The thread that was created
* @param {boolean} newlyCreated Whether the thread was newly created
*/
client.emit(Events.THREAD_CREATE, thread);
client.emit(Events.THREAD_CREATE, thread, data.newly_created ?? false);
}
return { thread };
}