mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
fix: apply v14 fix (#7756)
This commit is contained in:
@@ -18,9 +18,11 @@ class InteractionCreateAction extends Action {
|
|||||||
const client = this.client;
|
const client = this.client;
|
||||||
|
|
||||||
// Resolve and cache partial channels for Interaction#channel getter
|
// 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;
|
let InteractionType;
|
||||||
|
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case InteractionTypes.APPLICATION_COMMAND:
|
case InteractionTypes.APPLICATION_COMMAND:
|
||||||
switch (data.data.type) {
|
switch (data.data.type) {
|
||||||
@@ -31,6 +33,7 @@ class InteractionCreateAction extends Action {
|
|||||||
InteractionType = UserContextMenuInteraction;
|
InteractionType = UserContextMenuInteraction;
|
||||||
break;
|
break;
|
||||||
case ApplicationCommandTypes.MESSAGE:
|
case ApplicationCommandTypes.MESSAGE:
|
||||||
|
if (channel && !channel.isText()) return;
|
||||||
InteractionType = MessageContextMenuInteraction;
|
InteractionType = MessageContextMenuInteraction;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -42,6 +45,8 @@ class InteractionCreateAction extends Action {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case InteractionTypes.MESSAGE_COMPONENT:
|
case InteractionTypes.MESSAGE_COMPONENT:
|
||||||
|
if (channel && !channel.isText()) return;
|
||||||
|
|
||||||
switch (data.data.component_type) {
|
switch (data.data.component_type) {
|
||||||
case MessageComponentTypes.BUTTON:
|
case MessageComponentTypes.BUTTON:
|
||||||
InteractionType = ButtonInteraction;
|
InteractionType = ButtonInteraction;
|
||||||
|
|||||||
Reference in New Issue
Block a user