Package org.javacord.api.interaction
Interface SlashCommand
-
- All Superinterfaces:
ApplicationCommand,DiscordEntity,Specializable<ApplicationCommand>
public interface SlashCommand extends ApplicationCommand
-
-
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<SlashCommandOption>getOptions()Gets a list with 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
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
-
getOptions
java.util.List<SlashCommandOption> getOptions()
Gets a list with all options (i.e., parameters) for this command.- Returns:
- A list with 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.
-
-