Class ContextCommand.Message

Enclosing class:
ContextCommand

public abstract static class ContextCommand.Message extends ContextCommand
  • Constructor Details

    • Message

      public Message()
  • Method Details

    • execute

      public abstract void execute(net.dv8tion.jda.api.events.interaction.command.MessageContextInteractionEvent event)
      Abstract method that must be implemented for all Message Context Commands.
      
       public class PingContextMenu extends GuildContextCommand implements MessageContextCommand {
      
          public PingContextMenu() {
       		this.setCommandData(Commands.message("Ping"));
          }
      
          @Override
          public void handleMessageContextInteraction(MessageContextInteractionEvent event) {
       		event.reply("Pong!").queue();
          }
       }