Interface GroupChannel
-
- All Superinterfaces:
Channel,ChannelAttachableListenerManager,ChannelSpecialization,DiscordEntity,GroupChannelAttachableListenerManager,Messageable,Specializable<T>,TextChannel,TextChannelAttachableListenerManager,Updatable<T>,UpdatableFromCache,VoiceChannel,VoiceChannelAttachableListenerManager
public interface GroupChannel extends TextChannel, VoiceChannel, GroupChannelAttachableListenerManager
This class represents a group channel. Group channels are not supported by bot accounts!
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default GroupChannelUpdatercreateUpdater()Creates an updater for this channel.default Optional<GroupChannel>getCurrentCachedInstance()Gets an updated instance of this entity from the cache.Optional<Icon>getIcon()Gets the icon of the group channel.default CompletableFuture<GroupChannel>getLatestInstance()Gets an updated instance of this entity from the cache or from Discord directly.Collection<User>getMembers()Gets the members of the group channel.Optional<String>getName()Gets the name of the channel.default ChannelTypegetType()Gets the type of the channel.default booleanisMember(User user)Checks if the user is a member of this group channel.default CompletableFuture<Void>updateName(String name)Updates the name of the channel.-
Methods inherited from interface org.javacord.api.entity.channel.Channel
asCategorizable, asChannelCategory, asGroupChannel, asPrivateChannel, asServerChannel, 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.listener.channel.group.GroupChannelAttachableListenerManager
addGroupChannelAttachableListener, addGroupChannelChangeNameListener, addGroupChannelDeleteListener, getGroupChannelAttachableListeners, getGroupChannelChangeNameListeners, getGroupChannelDeleteListeners, removeGroupChannelAttachableListener, removeListener
-
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.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, 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
-
Methods inherited from interface org.javacord.api.entity.channel.VoiceChannel
canConnect, canMuteUsers, canYouConnect, canYouMuteUsers
-
Methods inherited from interface org.javacord.api.listener.channel.VoiceChannelAttachableListenerManager
addVoiceChannelAttachableListener, getVoiceChannelAttachableListeners, removeListener, removeVoiceChannelAttachableListener
-
-
-
-
Method Detail
-
getType
default ChannelType getType()
Description copied from interface:ChannelGets the type of the channel.
-
getMembers
Collection<User> getMembers()
Gets the members of the group channel.- Returns:
- The members of the group channel.
-
getIcon
Optional<Icon> getIcon()
Gets the icon of the group channel.- Returns:
- The icon of the group channel.
-
isMember
default boolean isMember(User user)
Checks if the user is a member of this group channel.- Parameters:
user- The user to check.- Returns:
- Whether the user is a member of this group channel or not.
-
createUpdater
default GroupChannelUpdater createUpdater()
Creates an updater for this channel.- Returns:
- An updater for this channel.
-
updateName
default CompletableFuture<Void> updateName(String name)
Updates the name of the channel.If you want to update several settings at once, it's recommended to use the
GroupChannelUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
name- The new name of the channel.- Returns:
- A future to check if the update was successful.
-
getCurrentCachedInstance
default Optional<GroupChannel> 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 interfaceTextChannel- Specified by:
getCurrentCachedInstancein interfaceUpdatableFromCache- Specified by:
getCurrentCachedInstancein interfaceVoiceChannel- Returns:
- The current cached instance.
-
getLatestInstance
default CompletableFuture<GroupChannel> 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 interfaceTextChannel- Specified by:
getLatestInstancein interfaceUpdatable<T extends DiscordEntity>- Specified by:
getLatestInstancein interfaceUpdatableFromCache- Specified by:
getLatestInstancein interfaceVoiceChannel- Returns:
- The current cached instance.
-
-