Skip to content

Commit

Permalink
feat: context menus
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Aug 13, 2021
1 parent 9eb57a5 commit 8c45dbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions events/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ module.exports = {
switch(interaction.type) {

case 'APPLICATION_COMMAND':

if (!client.interactions.commands.has(interaction.commandName)) return;
client.interactions.commands.get(interaction.commandName).execute(client, interaction);

const name = interaction.commandName
const command = client.interactions.commands.get(name) ?? client.interactions.commands.find(command => name == command.contextMenu)

if (!command) return;
return command.execute(client, interaction);
break;


Expand Down
2 changes: 1 addition & 1 deletion interactions/commands/g-spy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
name: 'g-spy',

contextMenu: 'Mark as g-spy',
async execute(client, interaction) {
const member = interaction.options.getMember('user');

Expand Down

0 comments on commit 8c45dbf

Please sign in to comment.