From ab6c2bad845d44b5d822b131e5e458a3637431c6 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Tue, 12 Apr 2022 16:11:57 +0100 Subject: [PATCH] fix: apply v14 fix (#7756) --- src/client/actions/InteractionCreate.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/actions/InteractionCreate.js b/src/client/actions/InteractionCreate.js index c869ea6ef86a..d96256e2d2d3 100644 --- a/src/client/actions/InteractionCreate.js +++ b/src/client/actions/InteractionCreate.js @@ -18,9 +18,11 @@ 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: switch (data.data.type) { @@ -31,6 +33,7 @@ class InteractionCreateAction extends Action { InteractionType = UserContextMenuInteraction; break; case ApplicationCommandTypes.MESSAGE: + if (channel && !channel.isText()) return; InteractionType = MessageContextMenuInteraction; break; default: @@ -42,6 +45,8 @@ class InteractionCreateAction extends Action { } break; case InteractionTypes.MESSAGE_COMPONENT: + if (channel && !channel.isText()) return; + switch (data.data.component_type) { case MessageComponentTypes.BUTTON: InteractionType = ButtonInteraction;