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 Default Methods Deprecated Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Void>delete()Deletes this application command.java.util.concurrent.CompletableFuture<java.lang.Void>deleteForServer(long server)Deprecated.Usedelete()instead.default java.util.concurrent.CompletableFuture<java.lang.Void>deleteForServer(Server server)Deprecated.Usedelete()instead.java.util.concurrent.CompletableFuture<java.lang.Void>deleteGlobal()Deprecated.Usedelete()instead.longgetApplicationId()Gets the unique id of the application that this command belongs to.java.util.Optional<java.util.EnumSet<PermissionType>>getDefaultRequiredPermissions()Gets the default required permissions for this command.java.lang.StringgetDescription()Gets the description of this command.java.util.Map<DiscordLocale,java.lang.String>getDescriptionLocalizations()Gets the description localizations of this command.longgetId()Gets the unique id of this command.java.lang.StringgetName()Gets the name of this command.java.util.Map<DiscordLocale,java.lang.String>getNameLocalizations()Gets the name localizations of this command.java.util.Optional<Server>getServer()Gets the server of this command if it is not global.java.util.Optional<java.lang.Long>getServerId()Gets the server id of this command if it is not global.ApplicationCommandTypegetType()Gets the type of this application command.booleanisDisabledByDefault()Gets whether this command is disabled and only usable by server administrators by default.booleanisEnabledInDms()Gets whether this command can be used in DMs.booleanisGlobalApplicationCommand()Gets whether this application command is global.booleanisServerApplicationCommand()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:
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.
-
getType
ApplicationCommandType getType()
Gets the type of this application command.- Returns:
- The type of this command.
-
getName
java.lang.String getName()
Gets the name of this command.- Returns:
- The name of this command.
-
getNameLocalizations
java.util.Map<DiscordLocale,java.lang.String> getNameLocalizations()
Gets the name localizations of this command.- Returns:
- The name localizations of this command.
-
getDescription
java.lang.String getDescription()
Gets the description of this command.- Returns:
- The description of this command.
-
getDescriptionLocalizations
java.util.Map<DiscordLocale,java.lang.String> getDescriptionLocalizations()
Gets the description localizations of this command.- Returns:
- The description localizations of this command.
-
getDefaultRequiredPermissions
java.util.Optional<java.util.EnumSet<PermissionType>> getDefaultRequiredPermissions()
Gets the default required permissions for this command. This may differ from the actual permissions of the command if they have been changed by a server administrator.- Returns:
- The default required permissions for this command.
-
isDisabledByDefault
boolean isDisabledByDefault()
Gets whether this command is disabled and only usable by server administrators by default. Note that this is different togetDefaultRequiredPermissions()returningPermissionType.ADMINISTRATOR.- Returns:
- Whether this command is disabled by default.
-
isEnabledInDms
boolean isEnabledInDms()
Gets whether this command can be used in DMs. Will always returnfalsefor server commands.- Returns:
- Whether the command is enabled in DMs
-
getServerId
java.util.Optional<java.lang.Long> getServerId()
Gets the server id of this command if it is not global.- Returns:
- The server of this command.
-
getServer
java.util.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.
-
delete
java.util.concurrent.CompletableFuture<java.lang.Void> delete()
Deletes this application command.- Returns:
- A future to check if the deletion was successful.
-
deleteGlobal
@Deprecated java.util.concurrent.CompletableFuture<java.lang.Void> deleteGlobal()
Deprecated.Usedelete()instead.Deletes this application command globally.- Returns:
- A future to check if the deletion was successful.
-
deleteForServer
@Deprecated default java.util.concurrent.CompletableFuture<java.lang.Void> deleteForServer(Server server)
Deprecated.Usedelete()instead.Deletes this application command for a server.- Parameters:
server- The server where the command should be deleted from.- Returns:
- A future to check if the deletion was successful.
-
deleteForServer
@Deprecated java.util.concurrent.CompletableFuture<java.lang.Void> deleteForServer(long server)
Deprecated.Usedelete()instead.Deletes this application command for a server.- Parameters:
server- The server where the command should be deleted from.- Returns:
- A future to check if the deletion was successful.
-
-