Package org.javacord.api.entity.channel
Class ServerTextChannelUpdater
- java.lang.Object
-
- org.javacord.api.entity.channel.ServerChannelUpdater
-
- org.javacord.api.entity.channel.ServerTextChannelUpdater
-
public class ServerTextChannelUpdater extends ServerChannelUpdater
This class can be used to update server text channels.
-
-
Constructor Summary
Constructors Constructor Description ServerTextChannelUpdater(ServerTextChannel channel)Creates a new server text channel updater.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Permissionable & DiscordEntity>
ServerTextChannelUpdateraddPermissionOverwrite(T permissionable, Permissions permissions)Adds a permission overwrite for the given entity.ServerTextChannelUpdaterremoveCategory()Queues the category to be removed.<T extends Permissionable & DiscordEntity>
ServerTextChannelUpdaterremovePermissionOverwrite(T permissionable)Removes a permission overwrite for the given entity.ServerTextChannelUpdatersetAuditLogReason(String reason)Sets the reason for this update.ServerTextChannelUpdatersetCategory(ChannelCategory category)Queues the category to be updated.ServerTextChannelUpdatersetName(String name)Queues the name to be updated.ServerTextChannelUpdatersetNsfwFlag(boolean nsfw)Queues the nsfw to be updated.ServerTextChannelUpdatersetRawPosition(int rawPosition)Queues the raw position to be updated.ServerTextChannelUpdatersetSlowmodeDelayInSeconds(int delay)Set the delay for slowmode.ServerTextChannelUpdatersetTopic(String topic)Queues the topic to be updated.ServerTextChannelUpdaterunsetSlowmode()Unset the slowmode.CompletableFuture<Void>update()Performs the queued updates.
-
-
-
Constructor Detail
-
ServerTextChannelUpdater
public ServerTextChannelUpdater(ServerTextChannel channel)
Creates a new server text channel updater.- Parameters:
channel- The channel to update.
-
-
Method Detail
-
setTopic
public ServerTextChannelUpdater setTopic(String topic)
Queues the topic to be updated.- Parameters:
topic- The new topic of the channel.- Returns:
- The current instance in order to chain call methods.
-
setNsfwFlag
public ServerTextChannelUpdater setNsfwFlag(boolean nsfw)
Queues the nsfw to be updated.- Parameters:
nsfw- The new nsfw flag of the channel.- Returns:
- The current instance in order to chain call methods.
-
setCategory
public ServerTextChannelUpdater 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 ServerTextChannelUpdater removeCategory()
Queues the category to be removed.- Returns:
- The current instance in order to chain call methods.
-
setSlowmodeDelayInSeconds
public ServerTextChannelUpdater setSlowmodeDelayInSeconds(int delay)
Set the delay for slowmode.- Parameters:
delay- The delay in seconds.- Returns:
- The current instance in order to chain call methods.
-
unsetSlowmode
public ServerTextChannelUpdater unsetSlowmode()
Unset the slowmode.- Returns:
- The current instance in order to chain call methods.
-
setAuditLogReason
public ServerTextChannelUpdater 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 ServerTextChannelUpdater 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 ServerTextChannelUpdater 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> ServerTextChannelUpdater 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> ServerTextChannelUpdater 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.
-
-