Package org.javacord.api.interaction
Class SlashCommandPermissionsUpdater
- java.lang.Object
-
- org.javacord.api.interaction.SlashCommandPermissionsUpdater
-
public class SlashCommandPermissionsUpdater extends Object
-
-
Constructor Summary
Constructors Constructor Description SlashCommandPermissionsUpdater(Server server)Creates a new SlashCommandPermissionsUpdater for the given Server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SlashCommandPermissionsUpdateraddPermission(long id, SlashCommandPermissionType type, boolean permission)Add the permission to the slash command updater.SlashCommandPermissionsUpdateraddPermission(SlashCommandPermissions permission)Add the permission to the slash command updater.SlashCommandPermissionsUpdateraddPermissions(List<SlashCommandPermissions> permissions)Adds the permissions to the slash command updater.SlashCommandPermissionsUpdatersetPermissions(List<SlashCommandPermissions> permissions)Sets the permissions of the slash command updater.CompletableFuture<ServerSlashCommandPermissions>update(long commandId)Updates the command with the set permissions.
-
-
-
Constructor Detail
-
SlashCommandPermissionsUpdater
public SlashCommandPermissionsUpdater(Server server)
Creates a new SlashCommandPermissionsUpdater for the given Server.- Parameters:
server- The server where the slash command permissions should be applied on.
-
-
Method Detail
-
setPermissions
public SlashCommandPermissionsUpdater setPermissions(List<SlashCommandPermissions> permissions)
Sets the permissions of the slash command updater.- Parameters:
permissions- The permissions.- Returns:
- The current instance in order to chain call methods.
-
addPermission
public SlashCommandPermissionsUpdater addPermission(SlashCommandPermissions permission)
Add the permission to the slash command updater.- Parameters:
permission- The permission.- Returns:
- The current instance in order to chain call methods.
-
addPermission
public SlashCommandPermissionsUpdater addPermission(long id, SlashCommandPermissionType type, boolean permission)
Add the permission to the slash command updater.- Parameters:
id- The ID of the entity which should be updated.type- The type of the ID which may be a user or a role.permission- True if allowed, otherwise false.- Returns:
- The current instance in order to chain call methods.
-
addPermissions
public SlashCommandPermissionsUpdater addPermissions(List<SlashCommandPermissions> permissions)
Adds the permissions to the slash command updater.- Parameters:
permissions- The permissions.- Returns:
- The current instance in order to chain call methods.
-
update
public CompletableFuture<ServerSlashCommandPermissions> update(long commandId)
Updates the command with the set permissions. When updating multiple slash command permissions at once, prefer usingDiscordApi.batchUpdateSlashCommandPermissions(Server, List)as this requires only 1 request.- Parameters:
commandId- The ID of the command which should be updated.- Returns:
- The updated server slash command permissions.
-
-