Package org.javacord.api.interaction
Interface SlashCommand
-
- All Superinterfaces:
ApplicationCommand,DiscordEntity,Mentionable,Specializable<ApplicationCommand>
public interface SlashCommand extends ApplicationCommand, Mentionable
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static SlashCommandBuildercreatePrefilledSlashCommandBuilder(SlashCommand slashCommand)Create a new prefilled slash command builder from the given slash command.default SlashCommandUpdatercreateSlashCommandUpdater()Creates a slash command updater from this SlashCommand instance.java.util.List<java.lang.String>getFullCommandNames()Gets the full command names.default java.lang.StringgetMentionTag()Gets the mention tag of this slash command with its base name.default java.util.List<java.lang.String>getMentionTags()Gets all mention tags of this slash command taking the groups and subcommands into account.java.util.List<SlashCommandOption>getOptions()Gets all options (i.e., parameters) for this command.static SlashCommandBuilderwith(java.lang.String name, java.lang.String description)Create a new slash command builder with the given name and description.static SlashCommandBuilderwith(java.lang.String name, java.lang.String description, java.util.List<SlashCommandOption> options)Create a new slash command builder with the given name, description and options.static SlashCommandBuilderwith(java.lang.String name, java.lang.String description, SlashCommandOptionBuilder... options)Create a new slash command builder with the given name, description and options.static SlashCommandBuilderwithRequiredPermissions(java.lang.String name, java.lang.String description, java.util.EnumSet<PermissionType> requiredPermissions)Create a new slash command builder with the given name and description.static SlashCommandBuilderwithRequiredPermissions(java.lang.String name, java.lang.String description, java.util.List<SlashCommandOption> options, java.util.EnumSet<PermissionType> requiredPermissions)Create a new slash command builder with the given name, description and options.static SlashCommandBuilderwithRequiredPermissions(java.lang.String name, java.lang.String description, java.util.List<SlashCommandOption> options, PermissionType... requiredPermissions)Create a new slash command builder with the given name, description and options.static SlashCommandBuilderwithRequiredPermissions(java.lang.String name, java.lang.String description, PermissionType... requiredPermissions)Create a new slash command builder with the given name and description.-
Methods inherited from interface org.javacord.api.interaction.ApplicationCommand
delete, deleteForServer, deleteForServer, deleteGlobal, getApplicationId, getDefaultRequiredPermissions, getDescription, getDescriptionLocalizations, getId, getName, getNameLocalizations, getServer, getServerId, getType, isDisabledByDefault, isEnabledInDms, isGlobalApplicationCommand, isServerApplicationCommand
-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getIdAsString
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
-
-
-
Method Detail
-
getMentionTag
default java.lang.String getMentionTag()
Gets the mention tag of this slash command with its base name.- Specified by:
getMentionTagin interfaceMentionable- Returns:
- The mention tag of this slash command.
-
getMentionTags
default java.util.List<java.lang.String> getMentionTags()
Gets all mention tags of this slash command taking the groups and subcommands into account.- Returns:
- All mention tags of this slash command.
-
getFullCommandNames
java.util.List<java.lang.String> getFullCommandNames()
Gets the full command names.- Returns:
- All command names for this slash command.
-
getOptions
java.util.List<SlashCommandOption> getOptions()
Gets all options (i.e., parameters) for this command.- Returns:
- All options (i.e., parameters) for this command.
-
with
static SlashCommandBuilder with(java.lang.String name, java.lang.String description)
Create a new slash command builder with the given name and description. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
name- The name of the new slash command.description- The description of the new slash command.- Returns:
- The new slash command builder
-
with
static SlashCommandBuilder with(java.lang.String name, java.lang.String description, SlashCommandOptionBuilder... options)
Create a new slash command builder with the given name, description and options. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
name- The name of the new slash command.description- The description of the new slash command.options- The options to add to the command- Returns:
- The new slash command builder
-
with
static SlashCommandBuilder with(java.lang.String name, java.lang.String description, java.util.List<SlashCommandOption> options)
Create a new slash command builder with the given name, description and options. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
name- The name of the new slash command.description- The description of the new slash command.options- The options to add to the command- Returns:
- The new slash command builder
-
withRequiredPermissions
static SlashCommandBuilder withRequiredPermissions(java.lang.String name, java.lang.String description, PermissionType... requiredPermissions)
Create a new slash command builder with the given name and description. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
name- The name of the new slash command.description- The description of the new slash command.requiredPermissions- The required permissions to be able to use this command.- Returns:
- The new slash command builder
-
withRequiredPermissions
static SlashCommandBuilder withRequiredPermissions(java.lang.String name, java.lang.String description, java.util.EnumSet<PermissionType> requiredPermissions)
Create a new slash command builder with the given name and description. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
name- The name of the new slash command.description- The description of the new slash command.requiredPermissions- The required permissions to be able to use this command.- Returns:
- The new slash command builder
-
withRequiredPermissions
static SlashCommandBuilder withRequiredPermissions(java.lang.String name, java.lang.String description, java.util.List<SlashCommandOption> options, PermissionType... requiredPermissions)
Create a new slash command builder with the given name, description and options. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
name- The name of the new slash command.description- The description of the new slash command.options- The options to add to the commandrequiredPermissions- The required permissions to be able to use this command.- Returns:
- The new slash command builder
-
withRequiredPermissions
static SlashCommandBuilder withRequiredPermissions(java.lang.String name, java.lang.String description, java.util.List<SlashCommandOption> options, java.util.EnumSet<PermissionType> requiredPermissions)
Create a new slash command builder with the given name, description and options. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
name- The name of the new slash command.description- The description of the new slash command.options- The options to add to the commandrequiredPermissions- The required permissions to be able to use this command.- Returns:
- The new slash command builder
-
createPrefilledSlashCommandBuilder
static SlashCommandBuilder createPrefilledSlashCommandBuilder(SlashCommand slashCommand)
Create a new prefilled slash command builder from the given slash command. CallApplicationCommandBuilder.createForServer(Server)orApplicationCommandBuilder.createGlobal(DiscordApi)on the returned builder to submit to Discord.- Parameters:
slashCommand- The slash command which the slash command builder should be prefilled with.- Returns:
- The new prefilled slash command builder.
-
createSlashCommandUpdater
default SlashCommandUpdater createSlashCommandUpdater()
Creates a slash command updater from this SlashCommand instance.- Returns:
- The slash command updater for this SlashCommand instance.
-
-