Skip to content

Commit

Permalink
fix: apply v14 fix (#7756)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Apr 12, 2022
1 parent c9e4562 commit ab6c2ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/actions/InteractionCreate.js
Expand Up @@ -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) {
Expand All @@ -31,6 +33,7 @@ class InteractionCreateAction extends Action {
InteractionType = UserContextMenuInteraction;
break;
case ApplicationCommandTypes.MESSAGE:
if (channel && !channel.isText()) return;
InteractionType = MessageContextMenuInteraction;
break;
default:
Expand All @@ -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;
Expand Down

0 comments on commit ab6c2ba

Please sign in to comment.