Package org.javacord.api.interaction
Interface SlashCommand
-
- All Superinterfaces:
DiscordEntity
public interface SlashCommand extends DiscordEntity
-
-
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 an slash command updater from this SlashCommand instance.CompletableFuture<Void>deleteForServer(Server server)Deletes this slash command globally.CompletableFuture<Void>deleteGlobal()Deletes this slash command globally.longgetApplicationId()Gets the unique id of the application that this command belongs to.booleangetDefaultPermission()Gets the default permission of this command.StringgetDescription()Gets the description of this command.longgetId()Gets the unique id of this command.StringgetName()Gets the name of this command.List<SlashCommandOption>getOptions()Gets a list with all options (i.e., parameters) for this command.static SlashCommandBuilderwith(String name, String description)Create a new slash command builder with the given name and description.static SlashCommandBuilderwith(String name, String description, List<SlashCommandOption> options)Create a new slash command builder with the given name, description and options.static SlashCommandBuilderwith(String name, String description, SlashCommandOptionBuilder... options)Create a new slash command builder with the given name, description and options.-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getCreationTimestamp, getIdAsString
-
-
-
-
Method Detail
-
getId
long getId()
Gets the unique id of this command.- Specified by:
getIdin interfaceDiscordEntity- Returns:
- The unique id of this command.
- See Also:
- Discord docs
-
getApplicationId
long getApplicationId()
Gets the unique id of the application that this command belongs to.- Returns:
- The unique application id.
-
getName
String getName()
Gets the name of this command.- Returns:
- The name of this command.
-
getDescription
String getDescription()
Gets the description of this command.- Returns:
- The description of this command.
-
getOptions
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.
-
getDefaultPermission
boolean getDefaultPermission()
Gets the default permission of this command.- Returns:
- The default permission of this command.
-
deleteGlobal
CompletableFuture<Void> deleteGlobal()
Deletes this slash command globally.- Returns:
- A future to check if the deletion was successful.
-
deleteForServer
CompletableFuture<Void> deleteForServer(Server server)
Deletes this slash command globally.- Parameters:
server- The server where the command should be deleted from.- Returns:
- A future to check if the deletion was successful.
-
with
static SlashCommandBuilder with(String name, String description)
Create a new slash command builder with the given name and description. CallSlashCommandBuilder.createForServer(Server)orSlashCommandBuilder.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(String name, String description, SlashCommandOptionBuilder... options)
Create a new slash command builder with the given name, description and options. CallSlashCommandBuilder.createForServer(Server)orSlashCommandBuilder.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(String name, String description, List<SlashCommandOption> options)
Create a new slash command builder with the given name, description and options. CallSlashCommandBuilder.createForServer(Server)orSlashCommandBuilder.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
-
createPrefilledSlashCommandBuilder
static SlashCommandBuilder createPrefilledSlashCommandBuilder(SlashCommand slashCommand)
Create a new prefilled slash command builder from the given slash command. CallSlashCommandBuilder.createForServer(Server)orSlashCommandBuilder.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 an slash command updater from this SlashCommand instance.- Returns:
- The slash command updater for this SlashCommand instance.
-
-