Class SlashCommandEvent

    • Constructor Detail

      • SlashCommandEvent

        public SlashCommandEvent​(@Nonnull
                                 JDA api,
                                 long responseNumber,
                                 @Nonnull
                                 net.dv8tion.jda.internal.interactions.CommandInteractionImpl interaction)
    • Method Detail

      • getName

        @Nonnull
        public java.lang.String getName()
        Description copied from interface: CommandInteraction
        The command name.
        This can be useful for abstractions.

        Note that commands can have these following structures:

        • /name subcommandGroup subcommandName
        • /name subcommandName
        • /name
        You can use CommandInteraction.getCommandPath() to simplify your checks.
        Specified by:
        getName in interface CommandInteraction
        Returns:
        The command name
      • getSubcommandName

        @Nullable
        public java.lang.String getSubcommandName()
        Description copied from interface: CommandInteraction
        The subcommand name.
        This can be useful for abstractions.

        Note that commands can have these following structures:

        • /name subcommandGroup subcommandName
        • /name subcommandName
        • /name
        You can use CommandInteraction.getCommandPath() to simplify your checks.
        Specified by:
        getSubcommandName in interface CommandInteraction
        Returns:
        The subcommand name, or null if this is not a subcommand
      • getSubcommandGroup

        @Nullable
        public java.lang.String getSubcommandGroup()
        Description copied from interface: CommandInteraction
        The subcommand group name.
        This can be useful for abstractions.

        Note that commands can have these following structures:

        • /name subcommandGroup subcommandName
        • /name subcommandName
        • /name
        You can use CommandInteraction.getCommandPath() to simplify your checks.
        Specified by:
        getSubcommandGroup in interface CommandInteraction
        Returns:
        The subcommand group name, or null if this is not a subcommand group
      • getOptions

        @Nonnull
        public java.util.List<OptionMapping> getOptions()
        Description copied from interface: CommandInteraction
        The options provided by the user when this command was executed.
        Each option has a name and value.
        Specified by:
        getOptions in interface CommandInteraction
        Returns:
        The options passed for this command
      • getCommandString

        @Nonnull
        public java.lang.String getCommandString()
        Description copied from interface: CommandInteraction
        Gets the slash command String for this slash command.
        This is similar to the String you see when clicking the interaction name in the client.

        Example return for an echo command: /say echo phrase: Say this

        Specified by:
        getCommandString in interface CommandInteraction
        Returns:
        The command String for this slash command