Package org.javacord.core.entity.server
Class ServerImpl
- java.lang.Object
-
- org.javacord.core.entity.server.ServerImpl
-
- All Implemented Interfaces:
Formattable
,DiscordEntity
,Nameable
,Server
,Updatable<Server>
,UpdatableFromCache<Server>
,ServerAttachableListenerManager
,InternalServerAttachableListenerManager
,Cleanupable
,DispatchQueueSelector
public class ServerImpl extends 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 void
addChannelToCache(ServerChannel channel)
Adds a channel to the cache.void
addCustomEmoji(KnownCustomEmoji emoji)
Adds a custom emoji.void
addMember(com.fasterxml.jackson.databind.JsonNode member)
Adds a member to the server.void
addMembers(com.fasterxml.jackson.databind.JsonNode members)
Adds members to the server.CompletableFuture<Void>
addRoleToUser(User user, Role role, String reason)
void
addServerReadyConsumer(Consumer<Server> consumer)
Adds a consumer which will be informed once the server is ready.CompletableFuture<Void>
banUser(User user, int deleteMessageDays, 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.CompletableFuture<Void>
delete()
boolean
equals(Object o)
Optional<ServerVoiceChannel>
getAfkChannel()
int
getAfkTimeoutInSeconds()
DiscordApi
getApi()
Gets the discord api instance.Optional<Long>
getApplicationId()
CompletableFuture<AuditLog>
getAuditLog(int limit)
CompletableFuture<AuditLog>
getAuditLog(int limit, AuditLogActionType type)
CompletableFuture<AuditLog>
getAuditLogBefore(int limit, AuditLogEntry before)
CompletableFuture<AuditLog>
getAuditLogBefore(int limit, AuditLogEntry before, AuditLogActionType type)
CompletableFuture<Collection<Ban>>
getBans()
Optional<ServerChannel>
getChannelById(long id)
List<ChannelCategory>
getChannelCategories()
List<ServerChannel>
getChannels()
Collection<KnownCustomEmoji>
getCustomEmojis()
DefaultMessageNotificationLevel
getDefaultMessageNotificationLevel()
ExplicitContentFilterLevel
getExplicitContentFilterLevel()
Optional<Icon>
getIcon()
String
getIconHash()
Gets the icon hash of the server.long
getId()
Gets the id of this object.CompletableFuture<Collection<RichInvite>>
getInvites()
Optional<Instant>
getJoinedAtTimestamp(User user)
Optional<User>
getMemberById(long id)
int
getMemberCount()
Collection<User>
getMembers()
MultiFactorAuthenticationLevel
getMultiFactorAuthenticationLevel()
String
getName()
Optional<String>
getNickname(User user)
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.ServerTextChannel
getOrCreateServerTextChannel(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.User
getOwner()
CompletableFuture<Integer>
getPruneCount(int days)
Region
getRegion()
Optional<Role>
getRoleById(long id)
List<Role>
getRoles()
Optional<Icon>
getSplash()
String
getSplashHash()
Gets the splash hash of the server.Optional<ServerTextChannel>
getSystemChannel()
List<ServerTextChannel>
getTextChannels()
Collection<ServerChannel>
getUnorderedChannels()
Gets an unordered collection with all channels in the server.VerificationLevel
getVerificationLevel()
List<ServerVoiceChannel>
getVoiceChannels()
CompletableFuture<List<Webhook>>
getWebhooks()
int
hashCode()
void
incrementMemberCount()
Increments the member count.boolean
isDeafened(long userId)
boolean
isLarge()
boolean
isMember(User user)
boolean
isMuted(long userId)
boolean
isReady()
Checks if the server is ready (all members are cached).boolean
isSelfDeafened(long userId)
boolean
isSelfMuted(long userId)
CompletableFuture<Void>
kickUser(User user, String reason)
CompletableFuture<Void>
leave()
CompletableFuture<Integer>
pruneMembers(int days, String reason)
void
removeChannelFromCache(long channelId)
Removes a channel from the cache.void
removeCustomEmoji(KnownCustomEmoji emoji)
Removes a custom emoji.void
removeMember(User user)
Removes a member from the server.void
removeRole(long roleId)
Removes a role from the cache.CompletableFuture<Void>
removeRoleFromUser(User user, Role role, String reason)
CompletableFuture<Void>
reorderRoles(List<Role> roles, String reason)
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
setDeafened(long userId, boolean deafened)
Sets the deafened state of the user with the given id.void
setDefaultMessageNotificationLevel(DefaultMessageNotificationLevel defaultMessageNotificationLevel)
Sets the default message notification level of the server.void
setExplicitContentFilterLevel(ExplicitContentFilterLevel explicitContentFilterLevel)
Sets the explicit content filter level of the server.void
setIconHash(String iconHash)
Sets the icon hash of the server.void
setMultiFactorAuthenticationLevel(MultiFactorAuthenticationLevel multiFactorAuthenticationLevel)
Sets the multi factor authentication level of the server.void
setMuted(long userId, boolean muted)
Sets the muted state of the user with the given id.void
setName(String name)
Sets the name of the server.void
setNickname(User user, String nickname)
Sets the nickname of the user.void
setOwnerId(long ownerId)
Sets the server owner id.void
setRegion(Region region)
Sets the region of the server.void
setSelfDeafened(long userId, boolean deafened)
Sets the self-deafened state of the user with the given id.void
setSelfMuted(long userId, boolean muted)
Sets the self-muted state of the user with the given id.void
setSplashHash(String splashHash)
Sets the splash hash of the server.void
setSystemChannelId(long systemChannelId)
Sets the system channel id of the server.void
setVerificationLevel(VerificationLevel verificationLevel)
Sets the verification level of the server.String
toString()
CompletableFuture<Void>
unbanUser(long userId, String reason)
-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getCreationTimestamp, getCreationTimestamp, getIdAsString
-
Methods inherited from interface org.javacord.core.listener.server.InternalServerAttachableListenerManager
addCachedMessagePinListener, addCachedMessageUnpinListener, addChannelPinsUpdateListener, addKnownCustomEmojiChangeNameListener, addKnownCustomEmojiChangeWhitelistedRolesListener, addKnownCustomEmojiCreateListener, addKnownCustomEmojiDeleteListener, addMessageCreateListener, addMessageDeleteListener, addMessageEditListener, addReactionAddListener, addReactionRemoveAllListener, addReactionRemoveListener, addRoleChangeColorListener, addRoleChangeHoistListener, addRoleChangeMentionableListener, addRoleChangeNameListener, addRoleChangePermissionsListener, addRoleChangePositionListener, addRoleCreateListener, addRoleDeleteListener, addServerAttachableListener, addServerBecomesUnavailableListener, addServerChangeAfkChannelListener, addServerChangeAfkTimeoutListener, addServerChangeDefaultMessageNotificationLevelListener, addServerChangeExplicitContentFilterLevelListener, addServerChangeIconListener, addServerChangeMultiFactorAuthenticationLevelListener, addServerChangeNameListener, addServerChangeOwnerListener, addServerChangeRegionListener, addServerChangeSplashListener, addServerChangeSystemChannelListener, addServerChangeVerificationLevelListener, addServerChannelChangeNameListener, addServerChannelChangeNsfwFlagListener, addServerChannelChangeOverwrittenPermissionsListener, addServerChannelChangePositionListener, addServerChannelCreateListener, addServerChannelDeleteListener, addServerLeaveListener, addServerMemberBanListener, addServerMemberJoinListener, addServerMemberLeaveListener, addServerMemberUnbanListener, addServerTextChannelChangeSlowmodeListener, addServerTextChannelChangeTopicListener, addServerVoiceChannelChangeBitrateListener, addServerVoiceChannelChangeUserLimitListener, addServerVoiceChannelMemberJoinListener, addServerVoiceChannelMemberLeaveListener, addUserChangeActivityListener, addUserChangeAvatarListener, addUserChangeDeafenedListener, addUserChangeDiscriminatorListener, addUserChangeMutedListener, addUserChangeNameListener, addUserChangeNicknameListener, addUserChangeSelfDeafenedListener, addUserChangeSelfMutedListener, addUserChangeStatusListener, addUserRoleAddListener, addUserRoleRemoveListener, addUserStartTypingListener, addWebhooksUpdateListener, getCachedMessagePinListeners, getCachedMessageUnpinListeners, getChannelPinsUpdateListeners, getKnownCustomEmojiChangeNameListeners, getKnownCustomEmojiChangeWhitelistedRolesListeners, getKnownCustomEmojiCreateListeners, getKnownCustomEmojiDeleteListeners, getMessageCreateListeners, getMessageDeleteListeners, getMessageEditListeners, getReactionAddListeners, getReactionRemoveAllListeners, getReactionRemoveListeners, getRoleChangeColorListeners, getRoleChangeHoistListeners, getRoleChangeMentionableListeners, getRoleChangeNameListeners, getRoleChangePermissionsListeners, getRoleChangePositionListeners, getRoleCreateListeners, getRoleDeleteListeners, getServerAttachableListeners, getServerBecomesUnavailableListeners, getServerChangeAfkChannelListeners, getServerChangeAfkTimeoutListeners, getServerChangeDefaultMessageNotificationLevelListeners, getServerChangeExplicitContentFilterLevelListeners, getServerChangeIconListeners, getServerChangeMultiFactorAuthenticationLevelListeners, getServerChangeNameListeners, getServerChangeOwnerListeners, getServerChangeRegionListeners, getServerChangeSplashListeners, getServerChangeSystemChannelListeners, getServerChangeVerificationLevelListeners, getServerChannelChangeNameListeners, getServerChannelChangeNsfwFlagListeners, getServerChannelChangeOverwrittenPermissionsListeners, getServerChannelChangePositionListeners, getServerChannelCreateListeners, getServerChannelDeleteListeners, getServerLeaveListeners, getServerMemberBanListeners, getServerMemberJoinListeners, getServerMemberLeaveListeners, getServerMemberUnbanListeners, getServerTextChannelChangeSlowmodeListeners, getServerTextChannelChangeTopicListeners, getServerVoiceChannelChangeBitrateListeners, getServerVoiceChannelChangeUserLimitListeners, getServerVoiceChannelMemberJoinListeners, getServerVoiceChannelMemberLeaveListeners, getUserChangeActivityListeners, getUserChangeAvatarListeners, getUserChangeDeafenedListeners, getUserChangeDiscriminatorListeners, getUserChangeMutedListeners, getUserChangeNameListeners, getUserChangeNicknameListeners, getUserChangeSelfDeafenedListeners, getUserChangeSelfMutedListeners, getUserChangeStatusListeners, getUserRoleAddListeners, getUserRoleRemoveListeners, getUserStartTypingListeners, getWebhooksUpdateListeners, removeListener, removeServerAttachableListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.javacord.api.entity.server.Server
addRoleToUser, areYouDeafened, areYouMuted, areYouSelfDeafened, areYouSelfMuted, banUser, banUser, canBanUser, canBanUsers, canChangeOwnNickname, canCreateChannels, canDeafenMembers, canKickUser, canKickUsers, canManage, canManageEmojis, canManageNicknames, canManageRole, canManageRoles, canManageRolesOf, canMoveMembers, canMuteMembers, canViewAuditLog, canYouBanUser, canYouBanUsers, canYouChangeOwnNickname, canYouCreateChannels, canYouDeafenMembers, canYouKickUser, canYouKickUsers, canYouManage, canYouManageEmojis, canYouManageNicknames, canYouManageRoles, canYouMoveMembers, canYouMuteMembers, canYouViewAuditLog, createChannelCategoryBuilder, createCustomEmojiBuilder, createRoleBuilder, createTextChannelBuilder, createUpdater, createVoiceChannelBuilder, deafenUser, deafenUser, deafenYourself, getAllowedPermissions, getChannelById, getChannelCategoriesByName, getChannelCategoriesByNameIgnoreCase, getChannelCategoryById, getChannelCategoryById, getChannelsByName, getChannelsByNameIgnoreCase, getConnectedVoiceChannel, getConnectedVoiceChannel, getCurrentCachedInstance, getCustomEmojiById, getCustomEmojiById, getCustomEmojisByName, getCustomEmojisByNameIgnoreCase, getDisplayName, getEveryoneRole, getHighestRole, getMemberByDiscriminatedName, getMemberByDiscriminatedNameIgnoreCase, getMemberById, getMemberByNameAndDiscriminator, getMemberByNameAndDiscriminatorIgnoreCase, getMembersByDisplayName, getMembersByDisplayNameIgnoreCase, getMembersByName, getMembersByNameIgnoreCase, getMembersByNickname, getMembersByNicknameIgnoreCase, getPermissions, getRoleById, getRoleColor, getRoles, getRolesByName, getRolesByNameIgnoreCase, getTextChannelById, getTextChannelById, getTextChannelsByName, getTextChannelsByNameIgnoreCase, getUnsetPermissions, getVisibleChannels, getVoiceChannelById, getVoiceChannelById, getVoiceChannelsByName, getVoiceChannelsByNameIgnoreCase, hasAnyPermission, hasPermission, hasPermissions, isAdmin, isDeafened, isMuted, isOwner, isSelfDeafened, isSelfMuted, kickUser, moveUser, moveYourself, muteUser, muteUser, muteYourself, pruneMembers, removeAfkChannel, removeIcon, removeRoleFromUser, removeSplash, removeSystemChannel, reorderRoles, resetNickname, resetNickname, setSystemChannel, unbanUser, unbanUser, unbanUser, unbanUser, unbanUser, undeafenUser, undeafenUser, undeafenYourself, unmuteUser, unmuteUser, unmuteYourself, updateAfkChannel, updateAfkTimeoutInSeconds, updateDefaultMessageNotificationLevel, updateExplicitContentFilterLevel, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateIcon, updateName, updateNickname, updateNickname, updateOwner, 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
-
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(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 String getIconHash()
Gets the icon hash of the server.- Returns:
- The icon hash of the server.
-
setIconHash
public void setIconHash(String iconHash)
Sets the icon hash of the server.- Parameters:
iconHash
- The icon hash of the server.
-
getSplashHash
public String getSplashHash()
Gets the splash hash of the server.- Returns:
- The splash hash of the server.
-
setSplashHash
public void setSplashHash(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.
-
addChannelToCache
public void addChannelToCache(ServerChannel channel)
Adds a channel to the cache.- Parameters:
channel
- The channel to add.
-
removeChannelFromCache
public void removeChannelFromCache(long channelId)
Removes a channel from the cache.- Parameters:
channelId
- The id of the channel to remove.
-
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.
-
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.
-
removeMember
public void removeMember(User user)
Removes a member from the server.- Parameters:
user
- The user to remove.
-
decrementMemberCount
public void decrementMemberCount()
Decrements the member count.
-
addMember
public void addMember(com.fasterxml.jackson.databind.JsonNode member)
Adds a member to the server.- Parameters:
member
- The user to add.
-
incrementMemberCount
public void incrementMemberCount()
Increments the member count.
-
setNickname
public void setNickname(User user, String nickname)
Sets the nickname of the user.- Parameters:
user
- The user.nickname
- The nickname to set.
-
setSelfMuted
public void setSelfMuted(long userId, boolean muted)
Sets the self-muted state of the user with the given id.- Parameters:
userId
- The id of the user.muted
- Whether the user with the given id is self-muted or not.
-
setSelfDeafened
public void setSelfDeafened(long userId, boolean deafened)
Sets the self-deafened state of the user with the given id.- Parameters:
userId
- The id of the user.deafened
- Whether the user with the given id is self-deafened or not.
-
setMuted
public void setMuted(long userId, boolean muted)
Sets the muted state of the user with the given id.- Parameters:
userId
- The id of the user.muted
- Whether the user with the given id is muted or not.
-
setDeafened
public void setDeafened(long userId, boolean deafened)
Sets the deafened state of the user with the given id.- Parameters:
userId
- The id of the user.deafened
- Whether the user with the given id is deafened or not.
-
addMembers
public void addMembers(com.fasterxml.jackson.databind.JsonNode members)
Adds members to the server.- Parameters:
members
- An array of guild member objects.
-
setName
public void setName(String name)
Sets the name of the server.- Parameters:
name
- The name of the server.
-
getUnorderedChannels
public Collection<ServerChannel> getUnorderedChannels()
Gets an unordered collection with all channels in the server.- Returns:
- An unordered collection with all channels in the server.
-
getApi
public DiscordApi getApi()
Description copied from interface:InternalServerAttachableListenerManager
Gets the discord api instance.- 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.
-
getNickname
public Optional<String> getNickname(User user)
- Specified by:
getNickname
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 Optional<Instant> getJoinedAtTimestamp(User user)
- Specified by:
getJoinedAtTimestamp
in interfaceServer
-
getMemberCount
public int getMemberCount()
- Specified by:
getMemberCount
in interfaceServer
-
getApplicationId
public Optional<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 Optional<ServerTextChannel> getSystemChannel()
- Specified by:
getSystemChannel
in interfaceServer
-
getAfkChannel
public Optional<ServerVoiceChannel> getAfkChannel()
- Specified by:
getAfkChannel
in interfaceServer
-
getAfkTimeoutInSeconds
public int getAfkTimeoutInSeconds()
- Specified by:
getAfkTimeoutInSeconds
in interfaceServer
-
getPruneCount
public CompletableFuture<Integer> getPruneCount(int days)
- Specified by:
getPruneCount
in interfaceServer
-
pruneMembers
public CompletableFuture<Integer> pruneMembers(int days, String reason)
- Specified by:
pruneMembers
in interfaceServer
-
getInvites
public CompletableFuture<Collection<RichInvite>> getInvites()
- Specified by:
getInvites
in interfaceServer
-
getMembers
public Collection<User> getMembers()
- Specified by:
getMembers
in interfaceServer
-
getMemberById
public Optional<User> getMemberById(long id)
- Specified by:
getMemberById
in interfaceServer
-
getRoleById
public Optional<Role> getRoleById(long id)
- Specified by:
getRoleById
in interfaceServer
-
delete
public CompletableFuture<Void> delete()
-
leave
public CompletableFuture<Void> leave()
-
addRoleToUser
public CompletableFuture<Void> addRoleToUser(User user, Role role, String reason)
- Specified by:
addRoleToUser
in interfaceServer
-
removeRoleFromUser
public CompletableFuture<Void> removeRoleFromUser(User user, Role role, String reason)
- Specified by:
removeRoleFromUser
in interfaceServer
-
reorderRoles
public CompletableFuture<Void> reorderRoles(List<Role> roles, 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
-
kickUser
public CompletableFuture<Void> kickUser(User user, String reason)
-
banUser
public CompletableFuture<Void> banUser(User user, int deleteMessageDays, String reason)
-
unbanUser
public CompletableFuture<Void> unbanUser(long userId, String reason)
-
getBans
public CompletableFuture<Collection<Ban>> getBans()
-
getWebhooks
public CompletableFuture<List<Webhook>> getWebhooks()
- Specified by:
getWebhooks
in interfaceServer
-
getAuditLog
public CompletableFuture<AuditLog> getAuditLog(int limit)
- Specified by:
getAuditLog
in interfaceServer
-
getAuditLog
public CompletableFuture<AuditLog> getAuditLog(int limit, AuditLogActionType type)
- Specified by:
getAuditLog
in interfaceServer
-
getAuditLogBefore
public CompletableFuture<AuditLog> getAuditLogBefore(int limit, AuditLogEntry before)
- Specified by:
getAuditLogBefore
in interfaceServer
-
getAuditLogBefore
public CompletableFuture<AuditLog> getAuditLogBefore(int limit, AuditLogEntry before, AuditLogActionType type)
- Specified by:
getAuditLogBefore
in interfaceServer
-
getCustomEmojis
public Collection<KnownCustomEmoji> getCustomEmojis()
- Specified by:
getCustomEmojis
in interfaceServer
-
getChannels
public List<ServerChannel> getChannels()
- Specified by:
getChannels
in interfaceServer
-
getChannelCategories
public List<ChannelCategory> getChannelCategories()
- Specified by:
getChannelCategories
in interfaceServer
-
getTextChannels
public List<ServerTextChannel> getTextChannels()
- Specified by:
getTextChannels
in interfaceServer
-
getVoiceChannels
public List<ServerVoiceChannel> getVoiceChannels()
- Specified by:
getVoiceChannels
in interfaceServer
-
getChannelById
public Optional<ServerChannel> getChannelById(long id)
- Specified by:
getChannelById
in interfaceServer
-
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
-
-