Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context menu commands are ran as slash commands. #26

Open
FisbanRegner opened this issue Jun 25, 2023 · 1 comment
Open

context menu commands are ran as slash commands. #26

FisbanRegner opened this issue Jun 25, 2023 · 1 comment

Comments

@FisbanRegner
Copy link

FisbanRegner commented Jun 25, 2023

user context message context and slash commands can have the same command name however your handler does not distinguish between the 3 and always runs the code for the slash command. regardless of the .js files actual name.
example if you have contexttest.js and its registered as type: ApplicationCommandType.message, with a name of test and you have a slashtest.js registered as type type: ApplicationCommandType.ChatInput, when you use the context menu it runs slashtest.js even though contexttest.js was the registered context message command with discord.

@FisbanRegner
Copy link
Author

FisbanRegner commented Jun 25, 2023

interaction responses for both command types message vs chatinput
MessageContextMenuCommandInteraction {
type: 2,
id: '1122412357910528091',
applicationId: '*',
channelId: '*',
guildId: '*',
user: User {*},
member: GuildMember {*},
version: 1,
appPermissions: PermissionsBitField { bitfield: * },
memberPermissions: PermissionsBitField { bitfield: * },
locale: 'en-US',
guildLocale: 'en-US',
commandId: '1122409387496063029',
commandName: 'approve',
commandType: 3,
commandGuildId: '1012556293879365702',
deferred: false,
replied: false,
ephemeral: null,
webhook: InteractionWebhook { * },
options: CommandInteractionOptionResolver {
_group: null,
_subcommand: null,
_hoistedOptions: [ [Object] ]
},
targetId: '*' //the id of the target message
ChatInputCommandInteraction {
type: 2,
id: '1122412818814226583',
applicationId: '*',
channelId: '*',
guildId: '*',
user: User {*},
member: GuildMember {*},
version: 1,
appPermissions: PermissionsBitField { bitfield: * },
memberPermissions: PermissionsBitField { bitfield: * },
locale: 'en-US',
guildLocale: 'en-US',
commandId: '1122409388326539362',
commandName: 'approve',
commandType: 1,
commandGuildId: '1012556293879365702',
deferred: false,
replied: false,
ephemeral: null,
webhook: InteractionWebhook { * },
options: CommandInteractionOptionResolver {
_group: null,
_subcommand: null,
_hoistedOptions: [ [Object] ]
}}

  • = values that are exactly the same removed to simplify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant