Package org.javacord.api.interaction
Interface ApplicationCommand
-
- All Superinterfaces:
DiscordEntity
,Specializable<ApplicationCommand>
- All Known Subinterfaces:
ContextMenu
,MessageContextMenu
,SlashCommand
,UserContextMenu
public interface ApplicationCommand extends DiscordEntity, Specializable<ApplicationCommand>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<Void>
deleteForServer(Server server)
Deletes this application command globally.CompletableFuture<Void>
deleteGlobal()
Deletes this application command globally.long
getApplicationId()
Gets the unique id of the application that this command belongs to.boolean
getDefaultPermission()
Gets the default permission of this command.String
getDescription()
Gets the description of this command.long
getId()
Gets the unique id of this command.String
getName()
Gets the name of this command.Optional<Server>
getServer()
Gets the server of this command if it is not global.ApplicationCommandType
getType()
Gets the type of this application command.boolean
isGlobalApplicationCommand()
Gets whether this application command is global.boolean
isServerApplicationCommand()
Gets whether this application command is a server application command.-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getIdAsString
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
-
-
-
Method Detail
-
getId
long getId()
Gets the unique id of this command.- Specified by:
getId
in 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.
-
getType
ApplicationCommandType getType()
Gets the type of this application command.- Returns:
- The type of this command.
-
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.
-
getDefaultPermission
boolean getDefaultPermission()
Gets the default permission of this command.- Returns:
- The default permission of this command.
-
getServer
Optional<Server> getServer()
Gets the server of this command if it is not global.- Returns:
- The server of this command.
-
isGlobalApplicationCommand
boolean isGlobalApplicationCommand()
Gets whether this application command is global.- Returns:
- If this application command is global or not.
-
isServerApplicationCommand
boolean isServerApplicationCommand()
Gets whether this application command is a server application command.- Returns:
- If this application command is a server application command or not.
-
deleteGlobal
CompletableFuture<Void> deleteGlobal()
Deletes this application command globally.- Returns:
- A future to check if the deletion was successful.
-
deleteForServer
CompletableFuture<Void> deleteForServer(Server server)
Deletes this application command globally.- Parameters:
server
- The server where the command should be deleted from.- Returns:
- A future to check if the deletion was successful.
-
-