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

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

Description

@snazzyfox

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions