Annotation Interface ContextMenu


@Retention(RUNTIME) @Target(TYPE) public @interface ContextMenu
Indicates that the annotated class serves as a Context Menu command.

Context Menu commands are a special type of Discord command that can be invoked directly on a user or message by right-clicking on them. These commands take no arguments and are useful for providing a quick way to perform actions on a specific target.

Example Usage:


 @ContextMenu(interactionName = "View Profile")
 public class ViewProfileMenu extends ModernBaseUserContextMenu { ... }
 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the interaction that will be displayed in Discord's right-click context menu.
  • Element Details

    • interactionName

      String interactionName
      The name of the interaction that will be displayed in Discord's right-click context menu.
      Returns:
      The interaction name.