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

Support for Context Menu (User and Message) Interactions #66

Open
snazzyfox opened this issue Aug 28, 2021 · 1 comment
Open

Support for Context Menu (User and Message) Interactions #66

snazzyfox opened this issue Aug 28, 2021 · 1 comment

Comments

@snazzyfox
Copy link

Discord recently shipped context menu commands for users and messages. It would be great if these can be supported as additional decorators.

They are, for the most part, registered and handled the same way as slash commands, with the only differences being:

  • There is no description
  • There are no options (the Interaction includes the user/message that the menu was used on)

An example usage would be something like:

@ContextMenu('Mute', 'USER')
@Guild(GUILD_ID)
@Permission(ROLE_ID, "ROLE")
private async mute(interaction: ContextMenuInteraction) {
    const user = await interaction.guild.members.fetch(interaction.targetId);
    await do_some_thing_with(message);
    interaction.reply("done with message");
}

An alternative is to have separate @MessageContextMenu and @UserContextMenu decorators instead of a single one where the type can be toggled. This does not make a practical difference, since discord.js does not distinguish between the two types of responses and the function signature remains the same.

@samarmeena
Copy link
Contributor

Hello, @snazzyfox

this package is currently not maintained, I suggest you should try, new improved version of this package and for context menu, try @ContextMenu

also see #62

Thanks

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

2 participants