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.ServerTextChannelUpdater
removeCategory()
Queues the category to be removed.<T extends Permissionable & DiscordEntity>
ServerTextChannelUpdaterremovePermissionOverwrite(T permissionable)
Removes a permission overwrite for the given entity.ServerTextChannelUpdater
setAuditLogReason(String reason)
Sets the reason for this update.ServerTextChannelUpdater
setCategory(ChannelCategory category)
Queues the category to be updated.ServerTextChannelUpdater
setName(String name)
Queues the name to be updated.ServerTextChannelUpdater
setNsfwFlag(boolean nsfw)
Queues the nsfw to be updated.ServerTextChannelUpdater
setRawPosition(int rawPosition)
Queues the raw position to be updated.ServerTextChannelUpdater
setSlowmodeDelayInSeconds(int delay)
Set the delay for slowmode.ServerTextChannelUpdater
setTopic(String topic)
Queues the topic to be updated.ServerTextChannelUpdater
unsetSlowmode()
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:ServerChannelUpdater
Sets the reason for this update. This reason will be visible in the audit log entry(s).- Overrides:
setAuditLogReason
in 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:ServerChannelUpdater
Queues the name to be updated.- Overrides:
setName
in 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:ServerChannelUpdater
Queues the raw position to be updated.- Overrides:
setRawPosition
in 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:ServerChannelUpdater
Adds a permission overwrite for the given entity.- Overrides:
addPermissionOverwrite
in classServerChannelUpdater
- Type Parameters:
T
- The type of entity to hold the permission, usuallyUser
orRole
- 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:ServerChannelUpdater
Removes a permission overwrite for the given entity.- Overrides:
removePermissionOverwrite
in classServerChannelUpdater
- Type Parameters:
T
- The type of entity to hold the permission, usuallyUser
orRole
- 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:ServerChannelUpdater
Performs the queued updates.- Overrides:
update
in classServerChannelUpdater
- Returns:
- A future to check if the update was successful.
-
-