Interface ApplicationCommandUpdaterDelegate<T extends ApplicationCommand>
-
- All Known Subinterfaces:
MessageContextMenuUpdaterDelegate,SlashCommandUpdaterDelegate,UserContextMenuUpdaterDelegate
public interface ApplicationCommandUpdaterDelegate<T extends ApplicationCommand>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddDescriptionLocalization(DiscordLocale locale, java.lang.String localization)Adds a description localization for the given locale.voidaddNameLocalization(DiscordLocale locale, java.lang.String localization)Adds a name localization for the given locale.voidsetDefaultDisabled()Sets whether this command should be disabled and only usable by server administrators by default.voidsetDefaultEnabledForEveryone()Enables this command for use by all users.voidsetDefaultEnabledForPermissions(java.util.EnumSet<PermissionType> requiredPermissions)Sets the default required permissions for this command.voidsetDescription(java.lang.String description)Sets the new description of the slash command.voidsetEnabledInDms(boolean enabledInDms)Sets whether this command is able to be used in DMs.voidsetName(java.lang.String name)Sets the new name of the application command.java.util.concurrent.CompletableFuture<T>updateForServer(DiscordApi api, long server)Performs the queued update.default java.util.concurrent.CompletableFuture<T>updateForServer(Server server)Performs the queued update.java.util.concurrent.CompletableFuture<T>updateGlobal(DiscordApi api)Performs the queued update.
-
-
-
Method Detail
-
setName
void setName(java.lang.String name)
Sets the new name of the application command.- Parameters:
name- The name to set.
-
addNameLocalization
void addNameLocalization(DiscordLocale locale, java.lang.String localization)
Adds a name localization for the given locale.- Parameters:
locale- The locale to add a localization for.localization- The command name localization.
-
setDescription
void setDescription(java.lang.String description)
Sets the new description of the slash command.- Parameters:
description- The description to set.
-
addDescriptionLocalization
void addDescriptionLocalization(DiscordLocale locale, java.lang.String localization)
Adds a description localization for the given locale.- Parameters:
locale- The locale to add this localization for.localization- The command description localization.
-
setDefaultEnabledForPermissions
void setDefaultEnabledForPermissions(java.util.EnumSet<PermissionType> requiredPermissions)
Sets the default required permissions for this command. This can later be overridden by server admins.- Parameters:
requiredPermissions- The required permissions to use this command.
-
setDefaultEnabledForEveryone
void setDefaultEnabledForEveryone()
Enables this command for use by all users. This can later be overridden by server admins.
-
setDefaultDisabled
void setDefaultDisabled()
Sets whether this command should be disabled and only usable by server administrators by default. This can later be overridden by server administrators.
-
setEnabledInDms
void setEnabledInDms(boolean enabledInDms)
Sets whether this command is able to be used in DMs. By default, this istrueThis has no effect on server commands.- Parameters:
enabledInDms- Whether the command is enabled in DMs.
-
updateGlobal
java.util.concurrent.CompletableFuture<T> updateGlobal(DiscordApi api)
Performs the queued update.- Parameters:
api- The DiscordApi.- Returns:
- A future with the updated application command to check if the update was successful.
-
updateForServer
default java.util.concurrent.CompletableFuture<T> updateForServer(Server server)
Performs the queued update.- Parameters:
server- The server where the command should be updated.- Returns:
- A future with the updated application command to check if the update was successful.
-
updateForServer
java.util.concurrent.CompletableFuture<T> updateForServer(DiscordApi api, long server)
Performs the queued update.- Parameters:
api- The DiscordApi.server- The server where the command should be updated.- Returns:
- A future with the updated application command to check if the update was successful.
-
-