Interface ApplicationCommandBuilderDelegate<T extends ApplicationCommand>
-
- All Known Subinterfaces:
MessageContextMenuBuilderDelegate,SlashCommandBuilderDelegate,UserContextMenuBuilderDelegate
public interface ApplicationCommandBuilderDelegate<T extends ApplicationCommand>
-
-
Method Summary
All Methods Instance Methods Abstract 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.java.util.concurrent.CompletableFuture<T>createForServer(DiscordApi api, long server)Creates an application command for a specific server.java.util.concurrent.CompletableFuture<T>createGlobal(DiscordApi api)Creates a global application command.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 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 name of the application command.
-
-
-
Method Detail
-
setName
void setName(java.lang.String name)
Sets the name of the application command.- Parameters:
name- The name.
-
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 description of the slash command.- Parameters:
description- The description.
-
addDescriptionLocalization
void addDescriptionLocalization(DiscordLocale locale, java.lang.String localization)
Adds a description localization for the given locale.- Parameters:
locale- The locale to add a 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.
-
createGlobal
java.util.concurrent.CompletableFuture<T> createGlobal(DiscordApi api)
Creates a global application command.- Parameters:
api- The discord api instance.- Returns:
- The built application command.
-
createForServer
java.util.concurrent.CompletableFuture<T> createForServer(DiscordApi api, long server)
Creates an application command for a specific server.- Parameters:
api- The discord api instance.server- The server.- Returns:
- The built application command.
-
-