Interface ServerTextChannel
-
- All Superinterfaces:
Categorizable,Channel,ChannelAttachableListenerManager,ChannelSpecialization,Comparable<T>,DiscordEntity,Formattable,Mentionable,Messageable,Nameable,ServerChannel,ServerChannelAttachableListenerManager,ServerTextChannelAttachableListenerManager,Specializable<T>,TextChannel,TextChannelAttachableListenerManager,Updatable<T>,UpdatableFromCache
public interface ServerTextChannel extends ServerChannel, TextChannel, Mentionable, Categorizable, ServerTextChannelAttachableListenerManager
This class represents a server text channel.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ServerTextChannelUpdatercreateUpdater()Creates an updater for this channel.default WebhookBuildercreateWebhookBuilder()Creates a webhook builder for this channel.default Optional<ServerTextChannel>getCurrentCachedInstance()Gets an updated instance of this entity from the cache.default CompletableFuture<ServerTextChannel>getLatestInstance()Gets an updated instance of this entity from the cache or from Discord directly.intgetSlowmodeDelayInSeconds()Gets the delay for slowmode.StringgetTopic()Gets the topic of the channel.default ChannelTypegetType()Gets the type of the channel.default booleanhasSlowmode()Check whether slowmode is activated for this channel.booleanisNsfw()Checks is the channel is "not safe for work".default CompletableFuture<Void>removeCategory()Removes the category of the channel.default CompletableFuture<Void>unsetSlowmode()Deactivate slowmode for this channel.default CompletableFuture<Void>updateCategory(ChannelCategory category)Updates the category of the channel.default CompletableFuture<Void>updateNsfwFlag(boolean nsfw)Updates the nsfw flag of the channel.default CompletableFuture<Void>updateSlowmodeDelayInSeconds(int delay)Set a slowmode for this channel.default CompletableFuture<Void>updateTopic(String topic)Updates the topic of the channel.-
Methods inherited from interface org.javacord.api.entity.channel.Categorizable
getCategory
-
Methods inherited from interface org.javacord.api.entity.channel.Channel
asCategorizable, asChannelCategory, asGroupChannel, asPrivateChannel, asServerChannel, asServerStageVoiceChannel, asServerTextChannel, asServerVoiceChannel, asTextChannel, asVoiceChannel, canSee, canYouSee
-
Methods inherited from interface org.javacord.api.listener.channel.ChannelAttachableListenerManager
addChannelAttachableListener, getChannelAttachableListeners, removeChannelAttachableListener, removeListener
-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getCreationTimestamp, getId, getIdAsString
-
Methods inherited from interface org.javacord.api.entity.Mentionable
getMentionTag
-
Methods inherited from interface org.javacord.api.entity.message.Messageable
sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage
-
Methods inherited from interface org.javacord.api.entity.channel.ServerChannel
canCreateInstantInvite, canYouCreateInstantInvite, compareTo, createInviteBuilder, delete, delete, getEffectiveAllowedPermissions, getEffectiveDeniedPermissions, getEffectiveOverwrittenPermissions, getEffectivePermissions, getInvites, getOverwrittenPermissions, getOverwrittenPermissions, getOverwrittenRolePermissions, getOverwrittenUserPermissions, getPosition, getRawPosition, getServer, hasAnyPermission, hasPermission, hasPermissions, updateName, updateRawPosition
-
Methods inherited from interface org.javacord.api.listener.channel.server.ServerChannelAttachableListenerManager
addServerChannelAttachableListener, addServerChannelChangeNameListener, addServerChannelChangeOverwrittenPermissionsListener, addServerChannelChangePositionListener, addServerChannelDeleteListener, addVoiceStateUpdateListener, getServerChannelAttachableListeners, getServerChannelChangeNameListeners, getServerChannelChangeOverwrittenPermissionsListeners, getServerChannelChangePositionListeners, getServerChannelDeleteListeners, getVoiceStateUpdateListeners, removeListener, removeServerChannelAttachableListener
-
Methods inherited from interface org.javacord.api.listener.channel.server.text.ServerTextChannelAttachableListenerManager
addServerChannelChangeNsfwFlagListener, addServerTextChannelAttachableListener, addServerTextChannelChangeSlowmodeListener, addServerTextChannelChangeTopicListener, addWebhooksUpdateListener, getServerChannelChangeNsfwFlagListeners, getServerTextChannelAttachableListeners, getServerTextChannelChangeSlowmodeListeners, getServerTextChannelChangeTopicListeners, getWebhooksUpdateListeners, removeListener, removeServerTextChannelAttachableListener
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
Methods inherited from interface org.javacord.api.entity.channel.TextChannel
bulkDelete, bulkDelete, bulkDelete, bulkDelete, canAddNewReactions, canAttachFiles, canEmbedLinks, canManageMessages, canMentionEveryone, canReadMessageHistory, canRemoveReactionsOfOthers, canUseExternalEmojis, canUseTts, canWrite, canYouAddNewReactions, canYouAttachFiles, canYouEmbedLinks, canYouManageMessages, canYouMentionEveryone, canYouReadMessageHistory, canYouRemoveReactionsOfOthers, canYouUseExternalEmojis, canYouUseTts, canYouWrite, deleteMessages, deleteMessages, deleteMessages, deleteMessages, getIncomingWebhooks, getMessageById, getMessageById, getMessageCache, getMessages, getMessagesAfter, getMessagesAfter, getMessagesAfterAsStream, getMessagesAfterAsStream, getMessagesAfterUntil, getMessagesAfterUntil, getMessagesAfterWhile, getMessagesAfterWhile, getMessagesAround, getMessagesAround, getMessagesAroundAsStream, getMessagesAroundAsStream, getMessagesAroundUntil, getMessagesAroundUntil, getMessagesAroundWhile, getMessagesAroundWhile, getMessagesAsStream, getMessagesBefore, getMessagesBefore, getMessagesBeforeAsStream, getMessagesBeforeAsStream, getMessagesBeforeUntil, getMessagesBeforeUntil, getMessagesBeforeWhile, getMessagesBeforeWhile, getMessagesBetween, getMessagesBetween, getMessagesBetweenAsStream, getMessagesBetweenAsStream, getMessagesBetweenUntil, getMessagesBetweenUntil, getMessagesBetweenWhile, getMessagesBetweenWhile, getMessagesUntil, getMessagesWhile, getPins, getWebhooks, type, typeContinuously, typeContinuously, typeContinuouslyAfter, typeContinuouslyAfter
-
Methods inherited from interface org.javacord.api.listener.channel.TextChannelAttachableListenerManager
addCachedMessagePinListener, addCachedMessageUnpinListener, addChannelPinsUpdateListener, addMessageCreateListener, addMessageDeleteListener, addMessageEditListener, addReactionAddListener, addReactionRemoveAllListener, addReactionRemoveListener, addTextChannelAttachableListener, addUserStartTypingListener, getCachedMessagePinListeners, getCachedMessageUnpinListeners, getChannelPinsUpdateListeners, getMessageCreateListeners, getMessageDeleteListeners, getMessageEditListeners, getReactionAddListeners, getReactionRemoveAllListeners, getReactionRemoveListeners, getTextChannelAttachableListeners, getUserStartTypingListeners, removeListener, removeTextChannelAttachableListener
-
-
-
-
Method Detail
-
getType
default ChannelType getType()
Description copied from interface:ChannelGets the type of the channel.
-
isNsfw
boolean isNsfw()
Checks is the channel is "not safe for work".- Returns:
- Whether the channel is "not safe for work" or not.
-
getTopic
String getTopic()
Gets the topic of the channel.- Returns:
- The topic of the channel.
-
createWebhookBuilder
default WebhookBuilder createWebhookBuilder()
Creates a webhook builder for this channel.- Returns:
- A webhook builder.
-
createUpdater
default ServerTextChannelUpdater createUpdater()
Creates an updater for this channel.- Specified by:
createUpdaterin interfaceServerChannel- Returns:
- An updater for this channel.
-
updateTopic
default CompletableFuture<Void> updateTopic(String topic)
Updates the topic of the channel.If you want to update several settings at once, it's recommended to use the
ServerTextChannelUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
topic- The new topic of the channel.- Returns:
- A future to check if the update was successful.
-
updateNsfwFlag
default CompletableFuture<Void> updateNsfwFlag(boolean nsfw)
Updates the nsfw flag of the channel.If you want to update several settings at once, it's recommended to use the
ServerTextChannelUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
nsfw- The new nsfw flag of the channel.- Returns:
- A future to check if the update was successful.
-
updateCategory
default CompletableFuture<Void> updateCategory(ChannelCategory category)
Updates the category of the channel.If you want to update several settings at once, it's recommended to use the
ServerTextChannelUpdaterfromcreateUpdater()which provides a better performance!- Specified by:
updateCategoryin interfaceCategorizable- Parameters:
category- The new category of the channel.- Returns:
- A future to check if the update was successful.
-
removeCategory
default CompletableFuture<Void> removeCategory()
Removes the category of the channel.If you want to update several settings at once, it's recommended to use the
ServerTextChannelUpdaterfromcreateUpdater()which provides a better performance!- Specified by:
removeCategoryin interfaceCategorizable- Returns:
- A future to check if the update was successful.
-
getSlowmodeDelayInSeconds
int getSlowmodeDelayInSeconds()
Gets the delay for slowmode.- Returns:
- The delay in seconds.
-
hasSlowmode
default boolean hasSlowmode()
Check whether slowmode is activated for this channel.- Returns:
- Whether this channel enforces a slowmode.
-
updateSlowmodeDelayInSeconds
default CompletableFuture<Void> updateSlowmodeDelayInSeconds(int delay)
Set a slowmode for this channel.If you want to update several settings at once, it's recommended to use the
ServerTextChannelUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
delay- The slowmode delay in seconds.- Returns:
- A future to check if the update was successful.
-
unsetSlowmode
default CompletableFuture<Void> unsetSlowmode()
Deactivate slowmode for this channel.If you want to update several settings at once, it's recommended to use the
ServerTextChannelUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the update was successful.
-
getCurrentCachedInstance
default Optional<ServerTextChannel> getCurrentCachedInstance()
Description copied from interface:UpdatableFromCacheGets an updated instance of this entity from the cache. This is for example necessary if an instance got invalid by a reconnect to Discord which invalidates all existing instances which means they do not get any further updates from Discord applied. Due to that, references to instances should usually not be held for an extended period of time. If they are, this method can be used to retrieve the current instance from the cache, that gets updates from Discord, in case this one was invalidated.This method returns the currently cached entity, or an empty
Optionalif the entity is not cached any longer, for example because it was deleted or the message was thrown out of the cache.- Specified by:
getCurrentCachedInstancein interfaceChannel- Specified by:
getCurrentCachedInstancein interfaceServerChannel- Specified by:
getCurrentCachedInstancein interfaceTextChannel- Specified by:
getCurrentCachedInstancein interfaceUpdatableFromCache- Returns:
- The current cached instance.
-
getLatestInstance
default CompletableFuture<ServerTextChannel> getLatestInstance()
Description copied from interface:UpdatableGets an updated instance of this entity from the cache or from Discord directly. This is for example necessary if an instance got invalid by a reconnect to Discord which invalidates all existing instances which means they do not get any further updates from Discord applied. Due to that, references to instances should usually not be held for an extended period of time. If they are, this method can be used to retrieve the current instance from the cache if present or from Discord directly.This method returns the currently cached entity if present, or request the entity from Discord if it is not cached or not permanently cached. If the entity is a fully cached entity and is not in the cache any longer, for example because it was deleted or the message was thrown out of the cache, the
CompletableFuturecompletes exceptionally with aNoSuchElementException. If a request to Discord is made, the according remote call exception will be used to complete theCompletableFutureexceptionally.- Specified by:
getLatestInstancein interfaceChannel- Specified by:
getLatestInstancein interfaceServerChannel- Specified by:
getLatestInstancein interfaceTextChannel- Specified by:
getLatestInstancein interfaceUpdatable<T extends DiscordEntity>- Specified by:
getLatestInstancein interfaceUpdatableFromCache- Returns:
- The current cached instance.
-
-