Package org.javacord.core.entity.server
Class ServerImpl
- java.lang.Object
-
- org.javacord.core.entity.server.ServerImpl
-
- All Implemented Interfaces:
java.util.Formattable
,Deletable
,DiscordEntity
,Nameable
,Server
,Updatable<Server>
,UpdatableFromCache<Server>
,ServerAttachableListenerManager
,InternalServerAttachableListenerManager
,Cleanupable
,DispatchQueueSelector
public class ServerImpl extends java.lang.Object implements Server, Cleanupable, InternalServerAttachableListenerManager, DispatchQueueSelector
The implementation ofServer
.
-
-
Constructor Summary
Constructors Constructor Description ServerImpl(DiscordApiImpl api, com.fasterxml.jackson.databind.JsonNode data)
Creates a new server object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Member>
addAndGetMembers(com.fasterxml.jackson.databind.JsonNode membersJson)
Adds members to the server and returns the added members.void
addCustomEmoji(KnownCustomEmoji emoji)
Adds a custom emoji.MemberImpl
addMember(com.fasterxml.jackson.databind.JsonNode memberJson)
Adds a member to the server.void
addMembers(com.fasterxml.jackson.databind.JsonNode membersJson)
Adds members to the server.java.util.concurrent.CompletableFuture<java.lang.Void>
addRoleToUser(User user, Role role, java.lang.String reason)
void
addServerReadyConsumer(java.util.function.Consumer<Server> consumer)
Adds a consumer which will be informed once the server is ready.void
addSticker(Sticker sticker)
Adds a sticker to the server's cache.java.util.concurrent.CompletableFuture<java.lang.Void>
banUser(java.lang.String userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)
void
cleanup()
Does any cleanup that would prevent this instance from being eligible for garbage collection like cancelling scheduled repeated tasks or callingcleanup
on "owned" cleanupable objects.void
decrementMemberCount()
Decrements the member count.java.util.concurrent.CompletableFuture<java.lang.Void>
delete(java.lang.String reason)
boolean
equals(java.lang.Object o)
java.util.concurrent.CompletableFuture<ActiveThreads>
getActiveThreads()
java.util.Optional<ServerVoiceChannel>
getAfkChannel()
int
getAfkTimeoutInSeconds()
java.util.concurrent.CompletableFuture<java.util.List<Webhook>>
getAllIncomingWebhooks()
DiscordApi
getApi()
Gets the discord api instance.java.util.Optional<java.lang.Long>
getApplicationId()
java.util.Optional<AudioConnection>
getAudioConnection()
java.util.concurrent.CompletableFuture<AuditLog>
getAuditLog(int limit)
java.util.concurrent.CompletableFuture<AuditLog>
getAuditLog(int limit, AuditLogActionType type)
java.util.concurrent.CompletableFuture<AuditLog>
getAuditLogBefore(int limit, AuditLogEntry before)
java.util.concurrent.CompletableFuture<AuditLog>
getAuditLogBefore(int limit, AuditLogEntry before, AuditLogActionType type)
java.util.concurrent.CompletableFuture<java.util.Set<Ban>>
getBans()
java.util.concurrent.CompletableFuture<java.util.Set<Ban>>
getBans(java.lang.Integer limit, java.lang.Long after)
int
getBoostCount()
BoostLevel
getBoostLevel()
java.util.Optional<ServerChannel>
getChannelById(long id)
java.util.List<ChannelCategory>
getChannelCategories()
java.util.List<ServerChannel>
getChannels()
java.util.Set<KnownCustomEmoji>
getCustomEmojis()
DefaultMessageNotificationLevel
getDefaultMessageNotificationLevel()
java.util.Optional<java.lang.String>
getDescription()
java.util.Optional<Icon>
getDiscoverySplash()
java.lang.String
getDiscoverySplashHash()
Gets the discovery splash hash of the server.ExplicitContentFilterLevel
getExplicitContentFilterLevel()
java.util.Set<ServerFeature>
getFeatures()
java.util.List<ServerForumChannel>
getForumChannels()
java.util.Optional<Icon>
getIcon()
java.lang.String
getIconHash()
Gets the icon hash of the server.long
getId()
Gets the id of this object.java.util.concurrent.CompletableFuture<java.util.List<IncomingWebhook>>
getIncomingWebhooks()
java.util.concurrent.CompletableFuture<java.util.Set<RichInvite>>
getInvites()
java.util.Optional<java.time.Instant>
getJoinedAtTimestamp(User user)
java.util.Optional<java.lang.Integer>
getMaxMembers()
java.util.Optional<java.lang.Integer>
getMaxPresences()
java.util.Optional<java.lang.Integer>
getMaxVideoChannelUsers()
java.util.Optional<User>
getMemberById(long id)
int
getMemberCount()
java.util.Set<User>
getMembers()
java.util.Optional<ServerTextChannel>
getModeratorsOnlyChannel()
MultiFactorAuthenticationLevel
getMultiFactorAuthenticationLevel()
java.lang.String
getName()
java.util.Optional<java.lang.String>
getNickname(User user)
NsfwLevel
getNsfwLevel()
ChannelCategory
getOrCreateChannelCategory(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a channel category.Role
getOrCreateRole(com.fasterxml.jackson.databind.JsonNode data)
Gets or create a new role.ServerForumChannel
getOrCreateServerForumChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server forum channel.ServerStageVoiceChannel
getOrCreateServerStageVoiceChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server stage voice channel.ServerTextChannel
getOrCreateServerTextChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server text channel.ServerThreadChannel
getOrCreateServerThreadChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server text channel.ServerVoiceChannel
getOrCreateServerVoiceChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server voice channel.UnknownRegularServerChannel
getOrCreateUnknownRegularServerChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates an unknown regular server channel.UnknownServerChannel
getOrCreateUnknownServerChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates an unknown server channel.java.util.Optional<User>
getOwner()
long
getOwnerId()
java.util.Locale
getPreferredLocale()
java.util.concurrent.CompletableFuture<java.lang.Integer>
getPruneCount(int days)
java.util.Optional<Member>
getRealMemberById(long userId)
Gets the real member object for the user with the given id.java.util.Set<Member>
getRealMembers()
Gets the real member objects of the server.Region
getRegion()
java.util.Optional<RegularServerChannel>
getRegularChannelById(long id)
java.util.List<RegularServerChannel>
getRegularChannels()
java.util.Optional<Role>
getRoleById(long id)
java.util.List<Role>
getRoles()
java.util.List<Role>
getRoles(User user)
java.util.Optional<ServerTextChannel>
getRulesChannel()
java.util.Optional<java.time.Instant>
getServerBoostingSinceTimestamp(User user)
java.util.concurrent.CompletableFuture<SlashCommand>
getSlashCommandById(long commandId)
java.util.concurrent.CompletableFuture<java.util.Set<SlashCommand>>
getSlashCommands()
java.util.Optional<Icon>
getSplash()
java.lang.String
getSplashHash()
Gets the splash hash of the server.java.util.Set<Sticker>
getStickers()
java.util.Optional<ServerTextChannel>
getSystemChannel()
java.util.EnumSet<SystemChannelFlag>
getSystemChannelFlags()
java.util.List<ServerTextChannel>
getTextChannels()
java.util.List<ServerThreadChannel>
getThreadChannels()
java.util.Optional<java.time.Instant>
getTimeout(User user)
java.util.Set<ServerChannel>
getUnorderedChannels()
java.util.Optional<Icon>
getUserServerAvatar(User user)
java.util.Optional<Icon>
getUserServerAvatar(User user, int size)
java.util.Optional<java.lang.String>
getUserServerAvatarHash(User user)
java.util.Optional<VanityUrlCode>
getVanityUrlCode()
VerificationLevel
getVerificationLevel()
java.util.List<ServerVoiceChannel>
getVoiceChannels()
java.util.concurrent.CompletableFuture<java.util.List<Webhook>>
getWebhooks()
java.util.Optional<WelcomeScreen>
getWelcomeScreen()
java.util.Optional<java.lang.Long>
getWidgetChannelId()
boolean
hasAllMembersInCache()
int
hashCode()
void
incrementMemberCount()
Increments the member count.boolean
isDeafened(long userId)
boolean
isLarge()
boolean
isMember(User user)
boolean
isMuted(long userId)
boolean
isPending(long userId)
boolean
isPremiumProgressBarEnabled()
boolean
isReady()
Checks if the server is ready (all members are cached).boolean
isSelfDeafened(long userId)
boolean
isSelfMuted(long userId)
boolean
isWidgetEnabled()
java.util.concurrent.CompletableFuture<java.lang.Void>
joinServerThreadChannel(long channelId)
java.util.concurrent.CompletableFuture<java.lang.Void>
kickUser(User user, java.lang.String reason)
java.util.concurrent.CompletableFuture<java.lang.Void>
leave()
java.util.concurrent.CompletableFuture<java.lang.Void>
leaveServerThreadChannel(long channelId)
java.util.concurrent.CompletableFuture<java.lang.Integer>
pruneMembers(int days, java.lang.String reason)
void
removeAudioConnection(AudioConnection audioConnection)
Removes an audio connection from the server.void
removeCustomEmoji(KnownCustomEmoji emoji)
Removes a custom emoji.void
removeMember(long userId)
Removes a member from the server.void
removeRole(long roleId)
Removes a role from the cache.java.util.concurrent.CompletableFuture<java.lang.Void>
removeRoleFromUser(User user, Role role, java.lang.String reason)
void
removeSticker(Sticker sticker)
Removes a sticker from the server's cache.java.util.concurrent.CompletableFuture<java.lang.Void>
reorderRoles(java.util.List<Role> roles, java.lang.String reason)
java.util.concurrent.CompletableFuture<Ban>
requestBan(long userId)
java.util.concurrent.CompletableFuture<User>
requestMember(long userId)
void
requestMembersChunks()
java.util.concurrent.CompletableFuture<Sticker>
requestStickerById(long id)
java.util.concurrent.CompletableFuture<java.util.Set<Sticker>>
requestStickers()
void
selfDeafen()
void
selfMute()
void
selfUndeafen()
void
selfUnmute()
void
setAfkChannelId(long afkChannelId)
Sets the afk channel id of the server.void
setAfkTimeout(int afkTimeout)
Sets the afk timeout of the server.void
setApplicationId(long applicationId)
Sets the application id.void
setAudioConnection(AudioConnectionImpl audioConnection)
Sets the audio connection of the server.void
setBoostLevel(BoostLevel boostLevel)
Sets the boost level of the server.void
setDefaultMessageNotificationLevel(DefaultMessageNotificationLevel defaultMessageNotificationLevel)
Sets the default message notification level of the server.void
setDescription(java.lang.String description)
Sets the description of the server.void
setDiscoverySplashHash(java.lang.String discoverySplashHash)
Sets the discovery splash hash of the server.void
setExplicitContentFilterLevel(ExplicitContentFilterLevel explicitContentFilterLevel)
Sets the explicit content filter level of the server.void
setIconHash(java.lang.String iconHash)
Sets the icon hash of the server.void
setModeratorsOnlyChannelId(long moderatorsOnlyChannelId)
Sets the moderators-only channel of the server.void
setMultiFactorAuthenticationLevel(MultiFactorAuthenticationLevel multiFactorAuthenticationLevel)
Sets the multi factor authentication level of the server.void
setName(java.lang.String name)
Sets the name of the server.void
setNsfwLevel(NsfwLevel nsfwLevel)
Sets the NSFW level of the server.void
setOwnerId(long ownerId)
Sets the server owner id.void
setPendingAudioConnection(AudioConnectionImpl audioConnection)
Sets the pending audio connection of the server.void
setPreferredLocale(java.util.Locale preferredLocale)
Sets the preferred locale of the server.void
setRegion(Region region)
Sets the region of the server.void
setRulesChannelId(long rulesChannelId)
Sets the rules channel of the server.void
setServerBoostCount(int serverBoostCount)
Sets the server boost count of the server.void
setServerFeatures(java.util.Collection<ServerFeature> serverFeatures)
Sets the server feature of the server.void
setSplashHash(java.lang.String splashHash)
Sets the splash hash of the server.void
setSystemChannelFlag(int systemChannelFlag)
Sets the system channel flags.void
setSystemChannelId(long systemChannelId)
Sets the system channel id of the server.void
setVanityUrlCode(VanityUrlCode vanityUrlCode)
Sets the vanity url code of the server.void
setVerificationLevel(VerificationLevel verificationLevel)
Sets the verification level of the server.java.lang.String
toString()
java.util.concurrent.CompletableFuture<java.lang.Void>
unbanUser(long userId, java.lang.String reason)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javacord.api.entity.Deletable
delete, deleteAfter, deleteAfter, deleteAfter, deleteAfter
-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getCreationTimestamp, getIdAsString
-
Methods inherited from interface org.javacord.core.listener.server.InternalServerAttachableListenerManager
addApplicationCommandPermissionsUpdateListener, addAutocompleteCreateListener, addButtonClickListener, addCachedMessagePinListener, addCachedMessageUnpinListener, addChannelPinsUpdateListener, addInteractionCreateListener, addKnownCustomEmojiChangeNameListener, addKnownCustomEmojiChangeWhitelistedRolesListener, addKnownCustomEmojiCreateListener, addKnownCustomEmojiDeleteListener, addMessageComponentCreateListener, addMessageContextMenuCommandListener, addMessageCreateListener, addMessageDeleteListener, addMessageEditListener, addMessageReplyListener, addModalSubmitListener, addReactionAddListener, addReactionRemoveAllListener, addReactionRemoveListener, addRoleChangeColorListener, addRoleChangeHoistListener, addRoleChangeMentionableListener, addRoleChangeNameListener, addRoleChangePermissionsListener, addRoleChangePositionListener, addRoleCreateListener, addRoleDeleteListener, addSelectMenuChooseListener, addServerAttachableListener, addServerBecomesUnavailableListener, addServerChangeAfkChannelListener, addServerChangeAfkTimeoutListener, addServerChangeBoostCountListener, addServerChangeBoostLevelListener, addServerChangeDefaultMessageNotificationLevelListener, addServerChangeDescriptionListener, addServerChangeDiscoverySplashListener, addServerChangeExplicitContentFilterLevelListener, addServerChangeIconListener, addServerChangeModeratorsOnlyChannelListener, addServerChangeMultiFactorAuthenticationLevelListener, addServerChangeNameListener, addServerChangeNsfwLevelListener, addServerChangeOwnerListener, addServerChangePreferredLocaleListener, addServerChangeRegionListener, addServerChangeRulesChannelListener, addServerChangeServerFeatureListener, addServerChangeSplashListener, addServerChangeSystemChannelListener, addServerChangeVanityUrlCodeListener, addServerChangeVerificationLevelListener, addServerChannelChangeNameListener, addServerChannelChangeNsfwFlagListener, addServerChannelChangeOverwrittenPermissionsListener, addServerChannelChangePositionListener, addServerChannelCreateListener, addServerChannelDeleteListener, addServerChannelInviteCreateListener, addServerChannelInviteDeleteListener, addServerLeaveListener, addServerMemberBanListener, addServerMemberJoinListener, addServerMemberLeaveListener, addServerMembersChunkListener, addServerMemberUnbanListener, addServerPrivateThreadJoinListener, addServerStageVoiceChannelChangeTopicListener, addServerTextChannelChangeDefaultAutoArchiveDurationListener, addServerTextChannelChangeSlowmodeListener, addServerTextChannelChangeTopicListener, addServerThreadChannelChangeArchivedListener, addServerThreadChannelChangeArchiveTimestampListener, addServerThreadChannelChangeAutoArchiveDurationListener, addServerThreadChannelChangeInvitableListener, addServerThreadChannelChangeLastMessageIdListener, addServerThreadChannelChangeLockedListener, addServerThreadChannelChangeMemberCountListener, addServerThreadChannelChangeMessageCountListener, addServerThreadChannelChangeRateLimitPerUserListener, addServerThreadChannelChangeTotalMessageSentListener, addServerThreadChannelMembersUpdateListener, addServerThreadChannelUpdateListener, addServerThreadListSyncListener, addServerVoiceChannelChangeBitrateListener, addServerVoiceChannelChangeNsfwListener, addServerVoiceChannelChangeUserLimitListener, addServerVoiceChannelMemberJoinListener, addServerVoiceChannelMemberLeaveListener, addSlashCommandCreateListener, addStickerChangeDescriptionListener, addStickerChangeNameListener, addStickerChangeTagsListener, addStickerCreateListener, addStickerDeleteListener, addUserChangeActivityListener, addUserChangeAvatarListener, addUserChangeDeafenedListener, addUserChangeDiscriminatorListener, addUserChangeMutedListener, addUserChangeNameListener, addUserChangeNicknameListener, addUserChangePendingListener, addUserChangeSelfDeafenedListener, addUserChangeSelfMutedListener, addUserChangeServerAvatarListener, addUserChangeStatusListener, addUserChangeTimeoutListener, addUserContextMenuCommandListener, addUserRoleAddListener, addUserRoleRemoveListener, addUserStartTypingListener, addVoiceServerUpdateListener, addWebhooksUpdateListener, getApplicationCommandPermissionsUpdateListeners, getAutocompleteCreateListeners, getButtonClickListeners, getCachedMessagePinListeners, getCachedMessageUnpinListeners, getChannelPinsUpdateListeners, getInteractionCreateListeners, getKnownCustomEmojiChangeNameListeners, getKnownCustomEmojiChangeWhitelistedRolesListeners, getKnownCustomEmojiCreateListeners, getKnownCustomEmojiDeleteListeners, getMessageComponentCreateListeners, getMessageContextMenuCommandListeners, getMessageCreateListeners, getMessageDeleteListeners, getMessageEditListeners, getMessageReplyListeners, getModalSubmitListeners, getReactionAddListeners, getReactionRemoveAllListeners, getReactionRemoveListeners, getRoleChangeColorListeners, getRoleChangeHoistListeners, getRoleChangeMentionableListeners, getRoleChangeNameListeners, getRoleChangePermissionsListeners, getRoleChangePositionListeners, getRoleCreateListeners, getRoleDeleteListeners, getSelectMenuChooseListeners, getServerAttachableListeners, getServerBecomesUnavailableListeners, getServerChangeAfkChannelListeners, getServerChangeAfkTimeoutListeners, getServerChangeBoostCountListeners, getServerChangeBoostLevelListeners, getServerChangeDefaultMessageNotificationLevelListeners, getServerChangeDescriptionListeners, getServerChangeDiscoverySplashListeners, getServerChangeExplicitContentFilterLevelListeners, getServerChangeIconListeners, getServerChangeModeratorsOnlyChannelListeners, getServerChangeMultiFactorAuthenticationLevelListeners, getServerChangeNameListeners, getServerChangeNsfwLevelListeners, getServerChangeOwnerListeners, getServerChangePreferredLocaleListeners, getServerChangeRegionListeners, getServerChangeRulesChannelListeners, getServerChangeServerFeatureListeners, getServerChangeSplashListeners, getServerChangeSystemChannelListeners, getServerChangeVanityUrlCodeListeners, getServerChangeVerificationLevelListeners, getServerChannelChangeNameListeners, getServerChannelChangeNsfwFlagListeners, getServerChannelChangeOverwrittenPermissionsListeners, getServerChannelChangePositionListeners, getServerChannelCreateListeners, getServerChannelDeleteListeners, getServerChannelInviteCreateListeners, getServerChannelInviteDeleteListeners, getServerLeaveListeners, getServerMemberBanListeners, getServerMemberJoinListeners, getServerMemberLeaveListeners, getServerMembersChunkListeners, getServerMemberUnbanListeners, getServerPrivateThreadJoinListeners, getServerStageVoiceChannelChangeTopicListeners, getServerTextChannelChangeDefaultAutoArchiveDurationListeners, getServerTextChannelChangeSlowmodeListeners, getServerTextChannelChangeTopicListeners, getServerThreadChannelChangeArchivedListeners, getServerThreadChannelChangeArchiveTimestampListeners, getServerThreadChannelChangeAutoArchiveDurationListeners, getServerThreadChannelChangeInvitableListeners, getServerThreadChannelChangeLastMessageIdListeners, getServerThreadChannelChangeLockedListeners, getServerThreadChannelChangeMemberCountListeners, getServerThreadChannelChangeMessageCountListeners, getServerThreadChannelChangeRateLimitPerUserListeners, getServerThreadChannelChangeTotalMessageSentListeners, getServerThreadChannelMembersUpdateListeners, getServerThreadChannelUpdateListeners, getServerThreadListSyncListeners, getServerVoiceChannelChangeBitrateListeners, getServerVoiceChannelChangeNsfwListeners, getServerVoiceChannelChangeUserLimitListeners, getServerVoiceChannelMemberJoinListeners, getServerVoiceChannelMemberLeaveListeners, getSlashCommandCreateListeners, getStickerChangeDescriptionListeners, getStickerChangeNameListeners, getStickerChangeTagsListeners, getStickerCreateListeners, getStickerDeleteListeners, getUserChangeActivityListeners, getUserChangeAvatarListeners, getUserChangeDeafenedListeners, getUserChangeDiscriminatorListeners, getUserChangeMutedListeners, getUserChangeNameListeners, getUserChangeNicknameListeners, getUserChangePendingListeners, getUserChangeSelfDeafenedListeners, getUserChangeSelfMutedListeners, getUserChangeServerAvatarListeners, getUserChangeStatusListeners, getUserChangeTimeoutListeners, getUserContextMenuCommandListeners, getUserRoleAddListeners, getUserRoleRemoveListeners, getUserStartTypingListeners, getVoiceServerUpdateListeners, getWebhooksUpdateListeners, removeListener, removeServerAttachableListener
-
Methods inherited from interface org.javacord.api.entity.server.Server
addRoleToUser, areYouDeafened, areYouMuted, areYouSelfDeafened, areYouSelfMuted, banUser, banUser, banUser, banUser, banUser, banUser, banUser, banUser, banUser, banUser, banUser, banUser, banUser, banUser, canBanUser, canBanUsers, canChangeOwnNickname, canCreateChannels, canDeafenMembers, canKickUser, canKickUsers, canManage, canManageEmojis, canManageNicknames, canManageRole, canManageRoles, canManageRolesOf, canMoveMembers, canMuteMembers, canTimeoutUser, canTimeoutUsers, canUseSlashCommands, canViewAuditLog, canYouBanUser, canYouBanUsers, canYouChangeOwnNickname, canYouCreateChannels, canYouDeafenMembers, canYouKickUser, canYouKickUsers, canYouManage, canYouManageEmojis, canYouManageNicknames, canYouManageRoles, canYouMoveMembers, canYouMuteMembers, canYouTimeoutUser, canYouTimeoutUsers, canYouUseSlashCommands, canYouViewAuditLog, createChannelCategoryBuilder, createCustomEmojiBuilder, createRoleBuilder, createTextChannelBuilder, createUpdater, createVoiceChannelBuilder, deafenUser, deafenUser, deafenYourself, getActiveTimeout, getAllowedPermissions, getChannelById, getChannelCategoriesByName, getChannelCategoriesByNameIgnoreCase, getChannelCategoryById, getChannelCategoryById, getChannelsByName, getChannelsByNameIgnoreCase, getConnectedVoiceChannel, getConnectedVoiceChannel, getCurrentCachedInstance, getCustomEmojiById, getCustomEmojiById, getCustomEmojisByName, getCustomEmojisByNameIgnoreCase, getDisplayName, getEveryoneRole, getForumChannelById, getForumChannelById, getForumChannelsByName, getForumChannelsByNameIgnoreCase, getHighestRole, getMemberByDiscriminatedName, getMemberByDiscriminatedNameIgnoreCase, getMemberById, getMemberByNameAndDiscriminator, getMemberByNameAndDiscriminatorIgnoreCase, getMembersByDisplayName, getMembersByDisplayNameIgnoreCase, getMembersByName, getMembersByNameIgnoreCase, getMembersByNickname, getMembersByNicknameIgnoreCase, getPermissions, getRegularChannelById, getRegularChannelsByName, getRegularChannelsByNameIgnoreCase, getRoleById, getRoleColor, getRolesByName, getRolesByNameIgnoreCase, getStageVoiceChannelById, getStageVoiceChannelById, getStickerById, getStickerById, getStickersByName, getStickersByNameIgnoreCase, getTextChannelById, getTextChannelById, getTextChannelsByName, getTextChannelsByNameIgnoreCase, getThreadChannelById, getThreadChannelById, getUnknownChannelById, getUnknownChannelById, getUnknownRegularChannelById, getUnknownRegularChannelById, getUnsetPermissions, getVisibleChannels, getVoiceChannelById, getVoiceChannelById, getVoiceChannelsByName, getVoiceChannelsByNameIgnoreCase, getWidgetChannel, hasAnyPermission, hasPermission, hasPermissions, isAdmin, isDeafened, isMuted, isOwner, isSelfDeafened, isSelfMuted, joinServerThreadChannel, kickUser, kickUserFromVoiceChannel, leaveServerThreadChannel, moveUser, moveYourself, muteUser, muteUser, muteYourself, pruneMembers, removeAfkChannel, removeBanner, removeIcon, removeModeratorsOnlyChannel, removeRoleFromUser, removeRulesChannel, removeSplash, removeSystemChannel, removeUserTimeout, removeUserTimeout, reorderRoles, requestBan, requestMember, requestOwner, requestStickerById, resetNickname, resetNickname, setModeratorsOnlyChannel, setRulesChannel, setSystemChannel, timeoutUser, timeoutUser, timeoutUser, timeoutUser, unbanUser, unbanUser, unbanUser, unbanUser, unbanUser, undeafenUser, undeafenUser, undeafenYourself, unmuteUser, unmuteUser, unmuteYourself, updateAfkChannel, updateAfkTimeoutInSeconds, updateBanner, updateBanner, updateBanner, updateBanner, updateBanner, updateBanner, updateBanner, updateBanner, updateBanner, updateDefaultMessageNotificationLevel, updateExplicitContentFilterLevel, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateName, updateNickname, updateNickname, updateOwner, updatePreferredLocale, updateRegion, updateRoles, updateRoles, updateSplash, updateSplash, updateSplash, updateSplash, updateSplash, updateSplash, updateSplash, updateSplash, updateSplash, updateVerificationLevel
-
Methods inherited from interface org.javacord.api.entity.UpdatableFromCache
getLatestInstance
-
-
-
-
Constructor Detail
-
ServerImpl
public ServerImpl(DiscordApiImpl api, com.fasterxml.jackson.databind.JsonNode data)
Creates a new server object.- Parameters:
api
- The discord api instance.data
- The json data of the server.
-
-
Method Detail
-
setSystemChannelFlag
public void setSystemChannelFlag(int systemChannelFlag)
Sets the system channel flags.- Parameters:
systemChannelFlag
- The system channel flag.
-
isReady
public boolean isReady()
Checks if the server is ready (all members are cached).- Returns:
- Whether the server is ready or not.
-
addServerReadyConsumer
public void addServerReadyConsumer(java.util.function.Consumer<Server> consumer)
Adds a consumer which will be informed once the server is ready. If the server is already ready, it will immediately call the consumer, otherwise it will be called from the websocket reading thread.- Parameters:
consumer
- The consumer which should be called.
-
getIconHash
public java.lang.String getIconHash()
Gets the icon hash of the server.- Returns:
- The icon hash of the server.
-
setIconHash
public void setIconHash(java.lang.String iconHash)
Sets the icon hash of the server.- Parameters:
iconHash
- The icon hash of the server.
-
getSplashHash
public java.lang.String getSplashHash()
Gets the splash hash of the server.- Returns:
- The splash hash of the server.
-
setSplashHash
public void setSplashHash(java.lang.String splashHash)
Sets the splash hash of the server.- Parameters:
splashHash
- The splash hash of the server.
-
setSystemChannelId
public void setSystemChannelId(long systemChannelId)
Sets the system channel id of the server.- Parameters:
systemChannelId
- The system channel id of the server.
-
setAfkChannelId
public void setAfkChannelId(long afkChannelId)
Sets the afk channel id of the server.- Parameters:
afkChannelId
- The afk channel id of the server.
-
setAfkTimeout
public void setAfkTimeout(int afkTimeout)
Sets the afk timeout of the server.- Parameters:
afkTimeout
- The afk timeout to set.
-
setVerificationLevel
public void setVerificationLevel(VerificationLevel verificationLevel)
Sets the verification level of the server.- Parameters:
verificationLevel
- The verification level of the server.
-
setRegion
public void setRegion(Region region)
Sets the region of the server.- Parameters:
region
- The region of the server.
-
setDefaultMessageNotificationLevel
public void setDefaultMessageNotificationLevel(DefaultMessageNotificationLevel defaultMessageNotificationLevel)
Sets the default message notification level of the server.- Parameters:
defaultMessageNotificationLevel
- The default message notification level to set.
-
setOwnerId
public void setOwnerId(long ownerId)
Sets the server owner id.- Parameters:
ownerId
- The owner id to set.
-
setApplicationId
public void setApplicationId(long applicationId)
Sets the application id.- Parameters:
applicationId
- The application id to set.
-
setExplicitContentFilterLevel
public void setExplicitContentFilterLevel(ExplicitContentFilterLevel explicitContentFilterLevel)
Sets the explicit content filter level of the server.- Parameters:
explicitContentFilterLevel
- The explicit content filter level to set.
-
setMultiFactorAuthenticationLevel
public void setMultiFactorAuthenticationLevel(MultiFactorAuthenticationLevel multiFactorAuthenticationLevel)
Sets the multi factor authentication level of the server.- Parameters:
multiFactorAuthenticationLevel
- The multi factor authentication level to set.
-
removeRole
public void removeRole(long roleId)
Removes a role from the cache.- Parameters:
roleId
- The id of the role to remove.
-
addCustomEmoji
public void addCustomEmoji(KnownCustomEmoji emoji)
Adds a custom emoji.- Parameters:
emoji
- The emoji to add.
-
removeCustomEmoji
public void removeCustomEmoji(KnownCustomEmoji emoji)
Removes a custom emoji.- Parameters:
emoji
- The emoji to remove.
-
getOrCreateRole
public Role getOrCreateRole(com.fasterxml.jackson.databind.JsonNode data)
Gets or create a new role.- Parameters:
data
- The json data of the role.- Returns:
- The role.
-
getOrCreateChannelCategory
public ChannelCategory getOrCreateChannelCategory(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a channel category.- Parameters:
data
- The json data of the channel.- Returns:
- The server text channel.
-
getOrCreateServerTextChannel
public ServerTextChannel getOrCreateServerTextChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server text channel.- Parameters:
data
- The json data of the channel.- Returns:
- The server text channel.
-
getOrCreateServerThreadChannel
public ServerThreadChannel getOrCreateServerThreadChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server text channel.- Parameters:
data
- The json data of the channel.- Returns:
- The server text channel.
-
getOrCreateServerVoiceChannel
public ServerVoiceChannel getOrCreateServerVoiceChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server voice channel.- Parameters:
data
- The json data of the channel.- Returns:
- The server voice channel.
-
getOrCreateServerStageVoiceChannel
public ServerStageVoiceChannel getOrCreateServerStageVoiceChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server stage voice channel.- Parameters:
data
- The json data of the channel.- Returns:
- The server stage voice channel.
-
getOrCreateServerForumChannel
public ServerForumChannel getOrCreateServerForumChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates a server forum channel.- Parameters:
data
- The json data of the channel.- Returns:
- The server forum channel.
-
getOrCreateUnknownServerChannel
public UnknownServerChannel getOrCreateUnknownServerChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates an unknown server channel.- Parameters:
data
- The json data of the channel.- Returns:
- The unknown server channel.
-
getOrCreateUnknownRegularServerChannel
public UnknownRegularServerChannel getOrCreateUnknownRegularServerChannel(com.fasterxml.jackson.databind.JsonNode data)
Gets or creates an unknown regular server channel.- Parameters:
data
- The json data of the channel.- Returns:
- The unknown regular server channel.
-
removeMember
public void removeMember(long userId)
Removes a member from the server.- Parameters:
userId
- The id of the user to remove.
-
decrementMemberCount
public void decrementMemberCount()
Decrements the member count.
-
addMember
public MemberImpl addMember(com.fasterxml.jackson.databind.JsonNode memberJson)
Adds a member to the server.- Parameters:
memberJson
- The user to add.- Returns:
- The member.
-
incrementMemberCount
public void incrementMemberCount()
Increments the member count.
-
addMembers
public void addMembers(com.fasterxml.jackson.databind.JsonNode membersJson)
Adds members to the server.- Parameters:
membersJson
- An array of guild member objects.
-
addAndGetMembers
public java.util.List<Member> addAndGetMembers(com.fasterxml.jackson.databind.JsonNode membersJson)
Adds members to the server and returns the added members.- Parameters:
membersJson
- An array of guild member objects.- Returns:
- The added members.
-
setName
public void setName(java.lang.String name)
Sets the name of the server.- Parameters:
name
- The name of the server.
-
setRulesChannelId
public void setRulesChannelId(long rulesChannelId)
Sets the rules channel of the server.- Parameters:
rulesChannelId
- The rules channel of the server.
-
setModeratorsOnlyChannelId
public void setModeratorsOnlyChannelId(long moderatorsOnlyChannelId)
Sets the moderators-only channel of the server.- Parameters:
moderatorsOnlyChannelId
- The moderators-only channel of the server.
-
setBoostLevel
public void setBoostLevel(BoostLevel boostLevel)
Sets the boost level of the server.- Parameters:
boostLevel
- The boost level of the server.
-
setNsfwLevel
public void setNsfwLevel(NsfwLevel nsfwLevel)
Sets the NSFW level of the server.- Parameters:
nsfwLevel
- The NSFW level of the server.
-
setPreferredLocale
public void setPreferredLocale(java.util.Locale preferredLocale)
Sets the preferred locale of the server.- Parameters:
preferredLocale
- The preferred locale of the server.
-
setServerBoostCount
public void setServerBoostCount(int serverBoostCount)
Sets the server boost count of the server.- Parameters:
serverBoostCount
- The server boost count of the server.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of the server.- Parameters:
description
- The description of the server.
-
setDiscoverySplashHash
public void setDiscoverySplashHash(java.lang.String discoverySplashHash)
Sets the discovery splash hash of the server.- Parameters:
discoverySplashHash
- The discovery splash hash of the server.
-
getDiscoverySplashHash
public java.lang.String getDiscoverySplashHash()
Gets the discovery splash hash of the server.- Returns:
- The discovery splash hash of the server.
-
setVanityUrlCode
public void setVanityUrlCode(VanityUrlCode vanityUrlCode)
Sets the vanity url code of the server.- Parameters:
vanityUrlCode
- The vanity url code of the server.
-
setServerFeatures
public void setServerFeatures(java.util.Collection<ServerFeature> serverFeatures)
Sets the server feature of the server.- Parameters:
serverFeatures
- The server feature of the server.
-
getUnorderedChannels
public java.util.Set<ServerChannel> getUnorderedChannels()
- Specified by:
getUnorderedChannels
in interfaceServer
-
setAudioConnection
public void setAudioConnection(AudioConnectionImpl audioConnection)
Sets the audio connection of the server.- Parameters:
audioConnection
- The audio connection.
-
setPendingAudioConnection
public void setPendingAudioConnection(AudioConnectionImpl audioConnection)
Sets the pending audio connection of the server.A pending connection is a connect that is currently trying to connect to a websocket and establish an udp connection but has not finished.
- Parameters:
audioConnection
- The audio connection.
-
removeAudioConnection
public void removeAudioConnection(AudioConnection audioConnection)
Removes an audio connection from the server.- Parameters:
audioConnection
- The audio connection to remove.
-
getApi
public DiscordApi getApi()
Description copied from interface:InternalServerAttachableListenerManager
Gets the discord api instance.- Specified by:
getApi
in interfaceDeletable
- Specified by:
getApi
in interfaceDiscordEntity
- Specified by:
getApi
in interfaceInternalServerAttachableListenerManager
- Returns:
- The discord api instance.
-
getId
public long getId()
Description copied from interface:InternalServerAttachableListenerManager
Gets the id of this object.- Specified by:
getId
in interfaceDiscordEntity
- Specified by:
getId
in interfaceInternalServerAttachableListenerManager
- Returns:
- The id of this object.
-
getAudioConnection
public java.util.Optional<AudioConnection> getAudioConnection()
- Specified by:
getAudioConnection
in interfaceServer
-
getFeatures
public java.util.Set<ServerFeature> getFeatures()
- Specified by:
getFeatures
in interfaceServer
-
getBoostLevel
public BoostLevel getBoostLevel()
- Specified by:
getBoostLevel
in interfaceServer
-
getBoostCount
public int getBoostCount()
- Specified by:
getBoostCount
in interfaceServer
-
getRulesChannel
public java.util.Optional<ServerTextChannel> getRulesChannel()
- Specified by:
getRulesChannel
in interfaceServer
-
getDescription
public java.util.Optional<java.lang.String> getDescription()
- Specified by:
getDescription
in interfaceServer
-
getNsfwLevel
public NsfwLevel getNsfwLevel()
- Specified by:
getNsfwLevel
in interfaceServer
-
getModeratorsOnlyChannel
public java.util.Optional<ServerTextChannel> getModeratorsOnlyChannel()
- Specified by:
getModeratorsOnlyChannel
in interfaceServer
-
getVanityUrlCode
public java.util.Optional<VanityUrlCode> getVanityUrlCode()
- Specified by:
getVanityUrlCode
in interfaceServer
-
getDiscoverySplash
public java.util.Optional<Icon> getDiscoverySplash()
- Specified by:
getDiscoverySplash
in interfaceServer
-
getPreferredLocale
public java.util.Locale getPreferredLocale()
- Specified by:
getPreferredLocale
in interfaceServer
-
getNickname
public java.util.Optional<java.lang.String> getNickname(User user)
- Specified by:
getNickname
in interfaceServer
-
getServerBoostingSinceTimestamp
public java.util.Optional<java.time.Instant> getServerBoostingSinceTimestamp(User user)
- Specified by:
getServerBoostingSinceTimestamp
in interfaceServer
-
getTimeout
public java.util.Optional<java.time.Instant> getTimeout(User user)
- Specified by:
getTimeout
in interfaceServer
-
getUserServerAvatarHash
public java.util.Optional<java.lang.String> getUserServerAvatarHash(User user)
- Specified by:
getUserServerAvatarHash
in interfaceServer
-
getUserServerAvatar
public java.util.Optional<Icon> getUserServerAvatar(User user)
- Specified by:
getUserServerAvatar
in interfaceServer
-
getUserServerAvatar
public java.util.Optional<Icon> getUserServerAvatar(User user, int size)
- Specified by:
getUserServerAvatar
in interfaceServer
-
isSelfMuted
public boolean isSelfMuted(long userId)
- Specified by:
isSelfMuted
in interfaceServer
-
isSelfDeafened
public boolean isSelfDeafened(long userId)
- Specified by:
isSelfDeafened
in interfaceServer
-
isDeafened
public boolean isDeafened(long userId)
- Specified by:
isDeafened
in interfaceServer
-
getJoinedAtTimestamp
public java.util.Optional<java.time.Instant> getJoinedAtTimestamp(User user)
- Specified by:
getJoinedAtTimestamp
in interfaceServer
-
getMemberCount
public int getMemberCount()
- Specified by:
getMemberCount
in interfaceServer
-
getOwnerId
public long getOwnerId()
- Specified by:
getOwnerId
in interfaceServer
-
getApplicationId
public java.util.Optional<java.lang.Long> getApplicationId()
- Specified by:
getApplicationId
in interfaceServer
-
getVerificationLevel
public VerificationLevel getVerificationLevel()
- Specified by:
getVerificationLevel
in interfaceServer
-
getExplicitContentFilterLevel
public ExplicitContentFilterLevel getExplicitContentFilterLevel()
- Specified by:
getExplicitContentFilterLevel
in interfaceServer
-
getDefaultMessageNotificationLevel
public DefaultMessageNotificationLevel getDefaultMessageNotificationLevel()
- Specified by:
getDefaultMessageNotificationLevel
in interfaceServer
-
getMultiFactorAuthenticationLevel
public MultiFactorAuthenticationLevel getMultiFactorAuthenticationLevel()
- Specified by:
getMultiFactorAuthenticationLevel
in interfaceServer
-
getSystemChannel
public java.util.Optional<ServerTextChannel> getSystemChannel()
- Specified by:
getSystemChannel
in interfaceServer
-
getAfkChannel
public java.util.Optional<ServerVoiceChannel> getAfkChannel()
- Specified by:
getAfkChannel
in interfaceServer
-
getAfkTimeoutInSeconds
public int getAfkTimeoutInSeconds()
- Specified by:
getAfkTimeoutInSeconds
in interfaceServer
-
getPruneCount
public java.util.concurrent.CompletableFuture<java.lang.Integer> getPruneCount(int days)
- Specified by:
getPruneCount
in interfaceServer
-
pruneMembers
public java.util.concurrent.CompletableFuture<java.lang.Integer> pruneMembers(int days, java.lang.String reason)
- Specified by:
pruneMembers
in interfaceServer
-
getInvites
public java.util.concurrent.CompletableFuture<java.util.Set<RichInvite>> getInvites()
- Specified by:
getInvites
in interfaceServer
-
hasAllMembersInCache
public boolean hasAllMembersInCache()
- Specified by:
hasAllMembersInCache
in interfaceServer
-
requestMembersChunks
public void requestMembersChunks()
- Specified by:
requestMembersChunks
in interfaceServer
-
getMembers
public java.util.Set<User> getMembers()
- Specified by:
getMembers
in interfaceServer
-
getRealMembers
public java.util.Set<Member> getRealMembers()
Gets the real member objects of the server.- Returns:
- The real members.
-
getMemberById
public java.util.Optional<User> getMemberById(long id)
- Specified by:
getMemberById
in interfaceServer
-
getRealMemberById
public java.util.Optional<Member> getRealMemberById(long userId)
Gets the real member object for the user with the given id.- Parameters:
userId
- The id of the user.- Returns:
- The real member.
-
isWidgetEnabled
public boolean isWidgetEnabled()
- Specified by:
isWidgetEnabled
in interfaceServer
-
getWidgetChannelId
public java.util.Optional<java.lang.Long> getWidgetChannelId()
- Specified by:
getWidgetChannelId
in interfaceServer
-
getMaxPresences
public java.util.Optional<java.lang.Integer> getMaxPresences()
- Specified by:
getMaxPresences
in interfaceServer
-
getMaxMembers
public java.util.Optional<java.lang.Integer> getMaxMembers()
- Specified by:
getMaxMembers
in interfaceServer
-
getMaxVideoChannelUsers
public java.util.Optional<java.lang.Integer> getMaxVideoChannelUsers()
- Specified by:
getMaxVideoChannelUsers
in interfaceServer
-
getWelcomeScreen
public java.util.Optional<WelcomeScreen> getWelcomeScreen()
- Specified by:
getWelcomeScreen
in interfaceServer
-
isPremiumProgressBarEnabled
public boolean isPremiumProgressBarEnabled()
- Specified by:
isPremiumProgressBarEnabled
in interfaceServer
-
getRoleById
public java.util.Optional<Role> getRoleById(long id)
- Specified by:
getRoleById
in interfaceServer
-
delete
public java.util.concurrent.CompletableFuture<java.lang.Void> delete(java.lang.String reason)
-
leave
public java.util.concurrent.CompletableFuture<java.lang.Void> leave()
-
addRoleToUser
public java.util.concurrent.CompletableFuture<java.lang.Void> addRoleToUser(User user, Role role, java.lang.String reason)
- Specified by:
addRoleToUser
in interfaceServer
-
removeRoleFromUser
public java.util.concurrent.CompletableFuture<java.lang.Void> removeRoleFromUser(User user, Role role, java.lang.String reason)
- Specified by:
removeRoleFromUser
in interfaceServer
-
reorderRoles
public java.util.concurrent.CompletableFuture<java.lang.Void> reorderRoles(java.util.List<Role> roles, java.lang.String reason)
- Specified by:
reorderRoles
in interfaceServer
-
selfUnmute
public void selfUnmute()
- Specified by:
selfUnmute
in interfaceServer
-
selfDeafen
public void selfDeafen()
- Specified by:
selfDeafen
in interfaceServer
-
selfUndeafen
public void selfUndeafen()
- Specified by:
selfUndeafen
in interfaceServer
-
requestMember
public java.util.concurrent.CompletableFuture<User> requestMember(long userId)
- Specified by:
requestMember
in interfaceServer
-
kickUser
public java.util.concurrent.CompletableFuture<java.lang.Void> kickUser(User user, java.lang.String reason)
-
banUser
public java.util.concurrent.CompletableFuture<java.lang.Void> banUser(java.lang.String userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)
-
unbanUser
public java.util.concurrent.CompletableFuture<java.lang.Void> unbanUser(long userId, java.lang.String reason)
-
requestBan
public java.util.concurrent.CompletableFuture<Ban> requestBan(long userId)
- Specified by:
requestBan
in interfaceServer
-
getBans
public java.util.concurrent.CompletableFuture<java.util.Set<Ban>> getBans(java.lang.Integer limit, java.lang.Long after)
-
getBans
public java.util.concurrent.CompletableFuture<java.util.Set<Ban>> getBans()
-
getWebhooks
public java.util.concurrent.CompletableFuture<java.util.List<Webhook>> getWebhooks()
- Specified by:
getWebhooks
in interfaceServer
-
getAllIncomingWebhooks
public java.util.concurrent.CompletableFuture<java.util.List<Webhook>> getAllIncomingWebhooks()
- Specified by:
getAllIncomingWebhooks
in interfaceServer
-
getIncomingWebhooks
public java.util.concurrent.CompletableFuture<java.util.List<IncomingWebhook>> getIncomingWebhooks()
- Specified by:
getIncomingWebhooks
in interfaceServer
-
getAuditLog
public java.util.concurrent.CompletableFuture<AuditLog> getAuditLog(int limit)
- Specified by:
getAuditLog
in interfaceServer
-
getAuditLog
public java.util.concurrent.CompletableFuture<AuditLog> getAuditLog(int limit, AuditLogActionType type)
- Specified by:
getAuditLog
in interfaceServer
-
getAuditLogBefore
public java.util.concurrent.CompletableFuture<AuditLog> getAuditLogBefore(int limit, AuditLogEntry before)
- Specified by:
getAuditLogBefore
in interfaceServer
-
getAuditLogBefore
public java.util.concurrent.CompletableFuture<AuditLog> getAuditLogBefore(int limit, AuditLogEntry before, AuditLogActionType type)
- Specified by:
getAuditLogBefore
in interfaceServer
-
getCustomEmojis
public java.util.Set<KnownCustomEmoji> getCustomEmojis()
- Specified by:
getCustomEmojis
in interfaceServer
-
getSlashCommands
public java.util.concurrent.CompletableFuture<java.util.Set<SlashCommand>> getSlashCommands()
- Specified by:
getSlashCommands
in interfaceServer
-
getSlashCommandById
public java.util.concurrent.CompletableFuture<SlashCommand> getSlashCommandById(long commandId)
- Specified by:
getSlashCommandById
in interfaceServer
-
getChannels
public java.util.List<ServerChannel> getChannels()
- Specified by:
getChannels
in interfaceServer
-
getRegularChannels
public java.util.List<RegularServerChannel> getRegularChannels()
- Specified by:
getRegularChannels
in interfaceServer
-
getChannelCategories
public java.util.List<ChannelCategory> getChannelCategories()
- Specified by:
getChannelCategories
in interfaceServer
-
getTextChannels
public java.util.List<ServerTextChannel> getTextChannels()
- Specified by:
getTextChannels
in interfaceServer
-
getForumChannels
public java.util.List<ServerForumChannel> getForumChannels()
- Specified by:
getForumChannels
in interfaceServer
-
getVoiceChannels
public java.util.List<ServerVoiceChannel> getVoiceChannels()
- Specified by:
getVoiceChannels
in interfaceServer
-
getThreadChannels
public java.util.List<ServerThreadChannel> getThreadChannels()
- Specified by:
getThreadChannels
in interfaceServer
-
getChannelById
public java.util.Optional<ServerChannel> getChannelById(long id)
- Specified by:
getChannelById
in interfaceServer
-
getRegularChannelById
public java.util.Optional<RegularServerChannel> getRegularChannelById(long id)
- Specified by:
getRegularChannelById
in interfaceServer
-
joinServerThreadChannel
public java.util.concurrent.CompletableFuture<java.lang.Void> joinServerThreadChannel(long channelId)
- Specified by:
joinServerThreadChannel
in interfaceServer
-
leaveServerThreadChannel
public java.util.concurrent.CompletableFuture<java.lang.Void> leaveServerThreadChannel(long channelId)
- Specified by:
leaveServerThreadChannel
in interfaceServer
-
getActiveThreads
public java.util.concurrent.CompletableFuture<ActiveThreads> getActiveThreads()
- Specified by:
getActiveThreads
in interfaceServer
-
getStickers
public java.util.Set<Sticker> getStickers()
- Specified by:
getStickers
in interfaceServer
-
requestStickers
public java.util.concurrent.CompletableFuture<java.util.Set<Sticker>> requestStickers()
- Specified by:
requestStickers
in interfaceServer
-
requestStickerById
public java.util.concurrent.CompletableFuture<Sticker> requestStickerById(long id)
- Specified by:
requestStickerById
in interfaceServer
-
addSticker
public void addSticker(Sticker sticker)
Adds a sticker to the server's cache.- Parameters:
sticker
- The sticker to add to the server's cache.
-
removeSticker
public void removeSticker(Sticker sticker)
Removes a sticker from the server's cache.- Parameters:
sticker
- The sticker to remove from the server's cache.
-
cleanup
public void cleanup()
Description copied from interface:Cleanupable
Does any cleanup that would prevent this instance from being eligible for garbage collection like cancelling scheduled repeated tasks or callingcleanup
on "owned" cleanupable objects. This method has to be thread-safe and idempotent.- Specified by:
cleanup
in interfaceCleanupable
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSystemChannelFlags
public java.util.EnumSet<SystemChannelFlag> getSystemChannelFlags()
- Specified by:
getSystemChannelFlags
in interfaceServer
-
-