Package org.javacord.api.interaction
Class SlashCommandUpdater
- java.lang.Object
-
- org.javacord.api.interaction.SlashCommandUpdater
-
public class SlashCommandUpdater extends Object
-
-
Constructor Summary
Constructors Constructor Description SlashCommandUpdater(long commandId)Creates a new slash command updater.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SlashCommandUpdatersetDefaultPermission(boolean defaultPermission)Sets the new slash command default permission.SlashCommandUpdatersetDescription(String description)Sets the new description of the slash command.SlashCommandUpdatersetName(String name)Sets the new name of the slash command.SlashCommandUpdatersetSlashCommandOptions(List<SlashCommandOption> slashCommandOptions)Sets the new slash command options.CompletableFuture<SlashCommand>updateForServer(Server server)Updates an slash command on the given server.CompletableFuture<SlashCommand>updateGlobal(DiscordApi api)Updates a global slash command.
-
-
-
Method Detail
-
setName
public SlashCommandUpdater setName(String name)
Sets the new name of the slash command.- Parameters:
name- The name to set.- Returns:
- The current instance in order to chain call methods.
-
setDescription
public SlashCommandUpdater setDescription(String description)
Sets the new description of the slash command.- Parameters:
description- The description to set.- Returns:
- The current instance in order to chain call methods.
-
setSlashCommandOptions
public SlashCommandUpdater setSlashCommandOptions(List<SlashCommandOption> slashCommandOptions)
Sets the new slash command options.- Parameters:
slashCommandOptions- The slash command options to set.- Returns:
- The current instance in order to chain call methods.
-
setDefaultPermission
public SlashCommandUpdater setDefaultPermission(boolean defaultPermission)
Sets the new slash command default permission. When set to `false` no one will be able to use this command until you overwrite it. Disallowing the usage of this command includes absolutely every user even Administrators, Server owners and in direct messages.- Parameters:
defaultPermission- The default permission to set.- Returns:
- The current instance in order to chain call methods.
-
updateGlobal
public CompletableFuture<SlashCommand> updateGlobal(DiscordApi api)
Updates a global slash command. When used to update multiple global slash commands at onceDiscordApi.bulkOverwriteGlobalSlashCommands(List)should be used instead.- Parameters:
api- The DiscordApi instance.- Returns:
- The updated slash command.
-
updateForServer
public CompletableFuture<SlashCommand> updateForServer(Server server)
Updates an slash command on the given server. When used to update multiple server slash commands at onceDiscordApi.bulkOverwriteServerSlashCommands(Server, List)(List)} should be used instead.- Parameters:
server- The server where the command should be updated.- Returns:
- The updated slash command.
-
-