Skip to content

Commit

Permalink
fix(InteractionCreate): construct ContextMenuInteractions
Browse files Browse the repository at this point in the history
  • Loading branch information
monbrey committed Aug 6, 2021
1 parent 67a536d commit 98e6263
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/actions/InteractionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const Action = require('./Action');
const ButtonInteraction = require('../../structures/ButtonInteraction');
const CommandInteraction = require('../../structures/CommandInteraction');
const ContextMenuInteraction = require('../../structures/ContextMenuInteraction');
const SelectMenuInteraction = require('../../structures/SelectMenuInteraction');
const { Events, InteractionTypes, MessageComponentTypes } = require('../../util/Constants');

Expand All @@ -18,7 +19,11 @@ class InteractionCreateAction extends Action {
let InteractionType;
switch (data.type) {
case InteractionTypes.APPLICATION_COMMAND:
InteractionType = CommandInteraction;
if (typeof data.data.target_id === 'undefined') {
InteractionType = CommandInteraction;
} else {
InteractionType = ContextMenuInteraction;
}
break;
case InteractionTypes.MESSAGE_COMPONENT:
switch (data.data.component_type) {
Expand Down

0 comments on commit 98e6263

Please sign in to comment.