Interface BaseCommand

All Known Implementing Classes:
Alias, Command, DeployCommand, SubCommand

public interface BaseCommand
An interface used by Command, SubCommand, and Alias
  • Method Summary

    Modifier and Type
    Method
    Description
    default net.dv8tion.jda.api.interactions.components.buttons.Button
    createButton(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle style, String reference, String text)
    Creates a button with proper handling for this command.
    default net.dv8tion.jda.api.interactions.components.buttons.Button
    createButton(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle style, String reference, String text, net.dv8tion.jda.api.entities.emoji.Emoji emoji)
    Creates a button with proper handling for this command.
    default net.dv8tion.jda.api.interactions.components.buttons.Button
    createButton(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle style, String reference, net.dv8tion.jda.api.entities.emoji.Emoji emoji)
    Creates a button with proper handling for this command.
    default net.dv8tion.jda.api.interactions.components.selections.SelectMenu
    createSelectMenu(String reference, String placeHolder, MenuOption... options)
    Creates a select menu with proper handling for this command.
    default net.dv8tion.jda.api.interactions.components.selections.SelectMenu
    createSelectMenu(String reference, MenuOption... options)
    Creates a select menu with proper handling for this command.
    void
    execute(Interaction interaction)
     
     
     
    void
    prepareForCallback(String cmdLabel, net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event, ComplexCommandHandler handler)
     
    void
    prepareForCallback(String cmdLabel, net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent event, ComplexCommandHandler handler)
     
    void
    prepareForCompletion(net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event, ComplexCommandHandler handler)
     
    void
    prepareForExecution(List<String> arguments, net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.entities.Member sender, net.dv8tion.jda.api.entities.MessageChannel channel, boolean skipArguments, ComplexCommandHandler handler)
     
    void
    prepareForExecution(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event, ComplexCommandHandler handler)
     
  • Method Details

    • getLabel

      String getLabel()
    • getDescription

      String getDescription()
    • execute

      void execute(Interaction interaction)
    • prepareForExecution

      void prepareForExecution(List<String> arguments, net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.entities.Member sender, net.dv8tion.jda.api.entities.MessageChannel channel, boolean skipArguments, ComplexCommandHandler handler)
    • prepareForExecution

      void prepareForExecution(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event, ComplexCommandHandler handler)
    • prepareForCompletion

      void prepareForCompletion(net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent event, ComplexCommandHandler handler)
    • prepareForCallback

      void prepareForCallback(String cmdLabel, net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event, ComplexCommandHandler handler)
    • prepareForCallback

      void prepareForCallback(String cmdLabel, net.dv8tion.jda.api.events.interaction.component.SelectMenuInteractionEvent event, ComplexCommandHandler handler)
    • createButton

      default net.dv8tion.jda.api.interactions.components.buttons.Button createButton(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle style, String reference, String text)
      Creates a button with proper handling for this command.
      Parameters:
      style - The button style.
      reference - The reference to the button (or a URL).
      text - The text to display on the button.
      Returns:
      The button.
    • createButton

      default net.dv8tion.jda.api.interactions.components.buttons.Button createButton(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle style, String reference, net.dv8tion.jda.api.entities.emoji.Emoji emoji)
      Creates a button with proper handling for this command.
      Parameters:
      style - The button style.
      reference - The reference to the button (or a URL).
      emoji - The emoji to show on the button.
      Returns:
      The button.
    • createButton

      default net.dv8tion.jda.api.interactions.components.buttons.Button createButton(net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle style, String reference, String text, net.dv8tion.jda.api.entities.emoji.Emoji emoji)
      Creates a button with proper handling for this command.
      Parameters:
      style - The button style.
      reference - The reference to the button (or a URL).
      text - The text to show to the right of the emoji.
      emoji - The emoji to show on the button.
      Returns:
      The button.
    • createSelectMenu

      default net.dv8tion.jda.api.interactions.components.selections.SelectMenu createSelectMenu(String reference, MenuOption... options)
      Creates a select menu with proper handling for this command.
      Parameters:
      reference - The reference to the select menu.
      options - The options to show in the select menu.
      Returns:
      The select menu.
    • createSelectMenu

      default net.dv8tion.jda.api.interactions.components.selections.SelectMenu createSelectMenu(String reference, String placeHolder, MenuOption... options)
      Creates a select menu with proper handling for this command.
      Parameters:
      reference - The reference to the select menu.
      placeHolder - The placeholder to display in the menu.
      options - The options to show in the select menu.
      Returns:
      The select menu.