Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants