Class CommandEvent

java.lang.Object
de.presti.ree6.commands.CommandEvent

public class CommandEvent extends Object
Event class used to parse and provide Information about a command execution.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CommandEvent(String command, net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion textChannel, String[] arguments, net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent slashCommandInteractionEvent)
    Constructor used to save the Data.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the Arguments associated with the Event.
    getArguments(boolean parseFromSlash)
    Get the Arguments associated with the Event.
    net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion
    Get the TextChannel Entity associated with the Event.
    net.dv8tion.jda.api.entities.Guild
    Get the Guild Entity associated with the Event.
    net.dv8tion.jda.api.interactions.InteractionHook
    Get the InteractionHook from the SlashCommandInteractionEvent.
    net.dv8tion.jda.api.entities.Member
    Get the Member Entity associated with the Event.
    net.dv8tion.jda.api.entities.Message
    Get the Message Entity associated with the Event.
    net.dv8tion.jda.api.interactions.commands.OptionMapping
    Get an option from the slash command!
    getResource(String key, Object... parameters)
    Get a Message from the Guild specific Language Setting.
    net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
    Get the SlashCommandInteractionEvent Entity associated with the Event.
    Get the Subcommand of the Slash Command.
    Get the Subcommand Group of the Slash Command.
    net.dv8tion.jda.api.entities.User
    Get the User Entity associated with the Event.
    boolean
    Check if the Command Execution is a Slash Command or not.
    void
    reply(String message)
    Reply to the Command execution.
    void
    reply(String message, int deleteSecond)
    Reply to the Command execution.
    void
    reply(net.dv8tion.jda.api.entities.MessageEmbed message)
    Reply to the Command execution.
    void
    reply(net.dv8tion.jda.api.entities.MessageEmbed message, int deleteSecond)
    Reply to the Command execution.
    void
    reply(net.dv8tion.jda.api.utils.messages.MessageCreateData message)
    Reply to the Command execution.
    void
    reply(net.dv8tion.jda.api.utils.messages.MessageCreateData message, int deleteSecond)
    Reply to the Command execution.
    void
    update(net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.utils.messages.MessageEditData messageEditData)
    Update a Message that has been sent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CommandEvent

      public CommandEvent(String command, @Nonnull net.dv8tion.jda.api.entities.Member member, @Nonnull net.dv8tion.jda.api.entities.Guild guild, @Nullable net.dv8tion.jda.api.entities.Message message, @Nonnull net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion textChannel, @Nullable String[] arguments, @Nullable net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent slashCommandInteractionEvent)
      Constructor used to save the Data.
      Parameters:
      command - the Command Name.
      member - the Member Entity.
      guild - the Guild Entity.
      message - the Message Entity.
      textChannel - the TextChannel Entity.
      arguments - the given Arguments.
      slashCommandInteractionEvent - the SlashCommandInteractionEvent Entity.
  • Method Details

    • reply

      public void reply(String message)
      Reply to the Command execution.
      Parameters:
      message - the Message to reply with.
    • reply

      public void reply(String message, int deleteSecond)
      Reply to the Command execution.
      Parameters:
      message - the Message to reply with.
      deleteSecond - the Seconds to delete the Message after.
    • reply

      public void reply(net.dv8tion.jda.api.entities.MessageEmbed message)
      Reply to the Command execution.
      Parameters:
      message - the Message to reply with.
    • reply

      public void reply(net.dv8tion.jda.api.entities.MessageEmbed message, int deleteSecond)
      Reply to the Command execution.
      Parameters:
      message - the Message to reply with.
      deleteSecond - the Seconds to delete the Message after.
    • reply

      public void reply(net.dv8tion.jda.api.utils.messages.MessageCreateData message)
      Reply to the Command execution.
      Parameters:
      message - the Message to reply with.
    • reply

      public void reply(net.dv8tion.jda.api.utils.messages.MessageCreateData message, int deleteSecond)
      Reply to the Command execution.
      Parameters:
      message - the Message to reply with.
      deleteSecond - the Seconds to delete the Message after.
    • update

      public void update(@Nullable net.dv8tion.jda.api.entities.Message message, net.dv8tion.jda.api.utils.messages.MessageEditData messageEditData)
      Update a Message that has been sent.
      Parameters:
      message - the Message that has been sent.
      messageEditData - the Message Edit that is being used to update the message.
    • getResource

      public String getResource(String key, Object... parameters)
      Get a Message from the Guild specific Language Setting.
      Parameters:
      key - the Key of the Message.
      parameters - the Parameters to replace in the Message.
      Returns:
      the Message.
    • getUser

      @Nonnull public net.dv8tion.jda.api.entities.User getUser()
      Get the User Entity associated with the Event.
      Returns:
      the User Entity.
    • getMember

      @Nonnull public net.dv8tion.jda.api.entities.Member getMember()
      Get the Member Entity associated with the Event.
      Returns:
      the Member Entity.
    • getGuild

      @Nonnull public net.dv8tion.jda.api.entities.Guild getGuild()
      Get the Guild Entity associated with the Event.
      Returns:
      the Guild Entity.
    • getMessage

      @Nullable public net.dv8tion.jda.api.entities.Message getMessage()
      Get the Message Entity associated with the Event.
      Returns:
      the Message Entity.
    • getChannel

      @Nonnull public net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion getChannel()
      Get the TextChannel Entity associated with the Event.
      Returns:
      the TextChannel Entity.
    • getArguments

      public String[] getArguments()
      Get the Arguments associated with the Event.
      Returns:
      the Arguments.
    • getArguments

      public String[] getArguments(boolean parseFromSlash)
      Get the Arguments associated with the Event.
      Parameters:
      parseFromSlash - if the Arguments should be parsed from the SlashCommandInteractionEvent.
      Returns:
      the Arguments.
    • getSlashCommandInteractionEvent

      @Nullable public net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent getSlashCommandInteractionEvent()
      Get the SlashCommandInteractionEvent Entity associated with the Event.
      Returns:
      the SlashCommandInteractionEvent Entity.
    • getOption

      @Nullable public net.dv8tion.jda.api.interactions.commands.OptionMapping getOption(String name)
      Get an option from the slash command!
      Parameters:
      name - The option name.
      Returns:
      the OptionMapping of the option | or null.
    • getSubcommand

      public String getSubcommand()
      Get the Subcommand of the Slash Command.
      Returns:
      the Subcommand.
    • getSubcommandGroup

      public String getSubcommandGroup()
      Get the Subcommand Group of the Slash Command.
      Returns:
      the Subcommand Group.
    • isSlashCommand

      public boolean isSlashCommand()
      Check if the Command Execution is a Slash Command or not.
      Returns:
      true, if it is a Slash Command Execution. | false, if not.
    • getInteractionHook

      public net.dv8tion.jda.api.interactions.InteractionHook getInteractionHook()
      Get the InteractionHook from the SlashCommandInteractionEvent.
      Returns:
      the InteractionHook Entity.