Package org.javacord.api.entity.channel
Class ServerVoiceChannelUpdater
- java.lang.Object
-
- org.javacord.api.entity.channel.ServerChannelUpdater
-
- org.javacord.api.entity.channel.ServerVoiceChannelUpdater
-
public class ServerVoiceChannelUpdater extends ServerChannelUpdater
This class can be used to update server voice channels.
-
-
Constructor Summary
Constructors Constructor Description ServerVoiceChannelUpdater(ServerVoiceChannel channel)Creates a new server voice channel updater.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Permissionable & DiscordEntity>
ServerVoiceChannelUpdateraddPermissionOverwrite(T permissionable, Permissions permissions)Adds a permission overwrite for the given entity.ServerVoiceChannelUpdaterremoveCategory()Queues the category to be removed.<T extends Permissionable & DiscordEntity>
ServerVoiceChannelUpdaterremovePermissionOverwrite(T permissionable)Removes a permission overwrite for the given entity.ServerVoiceChannelUpdaterremoveUserLimit()Queues the user limit to be removed.ServerVoiceChannelUpdatersetAuditLogReason(String reason)Sets the reason for this update.ServerVoiceChannelUpdatersetBitrate(int bitrate)Queues the bitrate to be updated.ServerVoiceChannelUpdatersetCategory(ChannelCategory category)Queues the category to be updated.ServerVoiceChannelUpdatersetName(String name)Queues the name to be updated.ServerVoiceChannelUpdatersetRawPosition(int rawPosition)Queues the raw position to be updated.ServerVoiceChannelUpdatersetUserLimit(int userLimit)Queues the user limit to be updated.CompletableFuture<Void>update()Performs the queued updates.
-
-
-
Constructor Detail
-
ServerVoiceChannelUpdater
public ServerVoiceChannelUpdater(ServerVoiceChannel channel)
Creates a new server voice channel updater.- Parameters:
channel- The channel to update.
-
-
Method Detail
-
setBitrate
public ServerVoiceChannelUpdater setBitrate(int bitrate)
Queues the bitrate to be updated.- Parameters:
bitrate- The new bitrate of the channel.- Returns:
- The current instance in order to chain call methods.
-
setUserLimit
public ServerVoiceChannelUpdater setUserLimit(int userLimit)
Queues the user limit to be updated.- Parameters:
userLimit- The new user limit of the channel.- Returns:
- The current instance in order to chain call methods.
-
removeUserLimit
public ServerVoiceChannelUpdater removeUserLimit()
Queues the user limit to be removed.- Returns:
- The current instance in order to chain call methods.
-
setCategory
public ServerVoiceChannelUpdater setCategory(ChannelCategory category)
Queues the category to be updated.- Parameters:
category- The new category of the channel.- Returns:
- The current instance in order to chain call methods.
-
removeCategory
public ServerVoiceChannelUpdater removeCategory()
Queues the category to be removed.- Returns:
- The current instance in order to chain call methods.
-
setAuditLogReason
public ServerVoiceChannelUpdater setAuditLogReason(String reason)
Description copied from class:ServerChannelUpdaterSets the reason for this update. This reason will be visible in the audit log entry(s).- Overrides:
setAuditLogReasonin classServerChannelUpdater- Parameters:
reason- The reason for this update.- Returns:
- The current instance in order to chain call methods.
-
setName
public ServerVoiceChannelUpdater setName(String name)
Description copied from class:ServerChannelUpdaterQueues the name to be updated.- Overrides:
setNamein classServerChannelUpdater- Parameters:
name- The new name of the channel.- Returns:
- The current instance in order to chain call methods.
-
setRawPosition
public ServerVoiceChannelUpdater setRawPosition(int rawPosition)
Description copied from class:ServerChannelUpdaterQueues the raw position to be updated.- Overrides:
setRawPositionin classServerChannelUpdater- Parameters:
rawPosition- The new position of the channel. If you want to update the position based on other channels, make sure to useServerChannel.getRawPosition()instead ofServerChannel.getPosition()!- Returns:
- The current instance in order to chain call methods.
-
addPermissionOverwrite
public <T extends Permissionable & DiscordEntity> ServerVoiceChannelUpdater addPermissionOverwrite(T permissionable, Permissions permissions)
Description copied from class:ServerChannelUpdaterAdds a permission overwrite for the given entity.- Overrides:
addPermissionOverwritein classServerChannelUpdater- Type Parameters:
T- The type of entity to hold the permission, usuallyUserorRole- Parameters:
permissionable- The entity whose permissions should be overwritten.permissions- The permission overwrites.- Returns:
- The current instance in order to chain call methods.
-
removePermissionOverwrite
public <T extends Permissionable & DiscordEntity> ServerVoiceChannelUpdater removePermissionOverwrite(T permissionable)
Description copied from class:ServerChannelUpdaterRemoves a permission overwrite for the given entity.- Overrides:
removePermissionOverwritein classServerChannelUpdater- Type Parameters:
T- The type of entity to hold the permission, usuallyUserorRole- Parameters:
permissionable- The entity which permission overwrite should be removed.- Returns:
- The current instance in order to chain call methods.
-
update
public CompletableFuture<Void> update()
Description copied from class:ServerChannelUpdaterPerforms the queued updates.- Overrides:
updatein classServerChannelUpdater- Returns:
- A future to check if the update was successful.
-
-