Interface Server
-
- All Superinterfaces:
Deletable,DiscordEntity,java.util.Formattable,Nameable,ServerAttachableListenerManager,Updatable<Server>,UpdatableFromCache<Server>
public interface Server extends DiscordEntity, Nameable, Deletable, UpdatableFromCache<Server>, ServerAttachableListenerManager
The class represents a Discord server, sometimes also called guild.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.concurrent.CompletableFuture<java.lang.Void>addRoleToUser(User user, Role role)Adds the given role to the given server member.java.util.concurrent.CompletableFuture<java.lang.Void>addRoleToUser(User user, Role role, java.lang.String reason)Adds the given role to the given server member.default booleanareYouDeafened()Gets your deafened state.default booleanareYouMuted()Gets your muted state.default booleanareYouSelfDeafened()Gets your self-deafened state.default booleanareYouSelfMuted()Gets your self-muted state.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(long userId)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(long userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(long userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(long userId, java.time.Duration duration)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(long userId, java.time.Duration duration, java.lang.String reason)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(java.lang.String userId)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(java.lang.String userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit)Bans the given user from the server.java.util.concurrent.CompletableFuture<java.lang.Void>banUser(java.lang.String userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(java.lang.String userId, java.time.Duration duration)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(java.lang.String userId, java.time.Duration duration, java.lang.String reason)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(User user)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(User user, long deleteMessageDuration, java.util.concurrent.TimeUnit unit)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(User user, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(User user, java.time.Duration duration)Bans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>banUser(User user, java.time.Duration duration, java.lang.String reason)Bans the given user from the server.default booleancanBanUser(User user, User userToBan)Checks if the given user can ban the other user.default booleancanBanUsers(User user)Checks if the given user can ban users from the server.default booleancanChangeOwnNickname(User user)Checks if the given user can change its own nickname in the server.default booleancanCreateChannels(User user)Checks if the given user can create new channels.default booleancanDeafenMembers(User user)Checks if the given user can deafen members on the server.default booleancanKickUser(User user, User userToKick)Checks if the given user can kick the other user.default booleancanKickUsers(User user)Checks if the given user can kick users from the server.default booleancanManage(User user)Checks if the given user can manage the server.default booleancanManageEmojis(User user)Checks if the given user can manage emojis on the server.default booleancanManageNicknames(User user)Checks if the given user can manage nicknames on the server.default booleancanManageRole(User user, Role target)Checks if the user can manage the target role.default booleancanManageRoles(User user)Checks if the given user can manage roles on the server.default booleancanManageRolesOf(User user, User target)Checks if the user can manage the roles of the target user.default booleancanMoveMembers(User user)Checks if the given user can move members on the server.default booleancanMuteMembers(User user)Checks if the given user can mute members on the server.default booleancanUseSlashCommands(User user)Checks if the given user can use slash commands on the server.default booleancanViewAuditLog(User user)Checks if the given user can view the audit log of the server.default booleancanYouBanUser(User userToBan)Checks if the user of the connected account can ban the user.default booleancanYouBanUsers()Checks if the user of the connected account can ban users from the server.default booleancanYouChangeOwnNickname()Checks if the user of the connected account can change its own nickname in the server.default booleancanYouCreateChannels()Checks if the user of the connected account can create new channels.default booleancanYouDeafenMembers()Checks if the user of the connected account can deafen members on the server.default booleancanYouKickUser(User userToKick)Checks if the user of the connected account can kick the user.default booleancanYouKickUsers()Checks if the user of the connected account can kick users from the server.default booleancanYouManage()Checks if the user of the connected account can manage the server.default booleancanYouManageEmojis()Checks if the user of the connected account can manage emojis on the server.default booleancanYouManageNicknames()Checks if the user of the connected account can manage nicknames on the server.default booleancanYouManageRoles()Checks if the user of the connected account can manage roles on the server.default booleancanYouMoveMembers()Checks if the user of the connected account can move members on the server.default booleancanYouMuteMembers()Checks if the user of the connected account can mute members on the server.default booleancanYouUseSlashCommands()Checks if the user of the connected account can use slash commands on the server.default booleancanYouViewAuditLog()Checks if the user of the connected account can view the audit log of the server.default ChannelCategoryBuildercreateChannelCategoryBuilder()Creates a new channel category builder.default CustomEmojiBuildercreateCustomEmojiBuilder()Creates a custom emoji builder to create custom emojis.default RoleBuildercreateRoleBuilder()Creates a new role builder.default ServerTextChannelBuildercreateTextChannelBuilder()Creates a new server text channel builder.default ServerUpdatercreateUpdater()Creates an updater for this server.default ServerVoiceChannelBuildercreateVoiceChannelBuilder()Creates a new server voice channel builder.default java.util.concurrent.CompletableFuture<java.lang.Void>deafenUser(User user)Deafens the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>deafenUser(User user, java.lang.String reason)Deafens the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>deafenYourself()Deafens yourself on the server.java.util.concurrent.CompletableFuture<ActiveThreads>getActiveThreads()Gets the active threads in this Server.default java.util.Optional<java.time.Instant>getActiveTimeout(User user)Gets the timestamp of when the user's timeout will expire and the user will be able to communicate in the server again.java.util.Optional<ServerVoiceChannel>getAfkChannel()Gets the afk channel of the server.intgetAfkTimeoutInSeconds()Gets the afk timeout in seconds of the server.java.util.concurrent.CompletableFuture<java.util.List<Webhook>>getAllIncomingWebhooks()Gets all incoming webhooks in this server, they are not guaranteed to have an accessible token.default java.util.Set<PermissionType>getAllowedPermissions(User user)Get the allowed permissions of a given user.java.util.Optional<java.lang.Long>getApplicationId()Gets the application id of the server's owner.java.util.Optional<AudioConnection>getAudioConnection()Gets the audio connection in this server.java.util.concurrent.CompletableFuture<AuditLog>getAuditLog(int limit)Gets the audit log of this server.java.util.concurrent.CompletableFuture<AuditLog>getAuditLog(int limit, AuditLogActionType type)Gets the audit log of this server.java.util.concurrent.CompletableFuture<AuditLog>getAuditLogBefore(int limit, AuditLogEntry before)Gets the audit log of this server.java.util.concurrent.CompletableFuture<AuditLog>getAuditLogBefore(int limit, AuditLogEntry before, AuditLogActionType type)Gets the audit log of this server.java.util.concurrent.CompletableFuture<java.util.Set<Ban>>getBans()Gets all server bans.java.util.concurrent.CompletableFuture<java.util.Set<Ban>>getBans(java.lang.Integer limit, java.lang.Long after)Gets up tolimitserver bans, only taking users with an ID higher thanafterinto account.intgetBoostCount()Gets the boost count of the server.BoostLevelgetBoostLevel()Gets the boost level of the server.java.util.Optional<ServerChannel>getChannelById(long id)Gets a channel by its id.default java.util.Optional<ServerChannel>getChannelById(java.lang.String id)Gets a channel by its id.java.util.List<ChannelCategory>getChannelCategories()Gets a sorted list (by position) with all channel categories of the server.default java.util.List<ChannelCategory>getChannelCategoriesByName(java.lang.String name)Gets a sorted list (by position) with all channel categories with the given name.default java.util.List<ChannelCategory>getChannelCategoriesByNameIgnoreCase(java.lang.String name)Gets a sorted list (by position) with all channel categories with the given name.default java.util.Optional<ChannelCategory>getChannelCategoryById(long id)Gets a channel category by its id.default java.util.Optional<ChannelCategory>getChannelCategoryById(java.lang.String id)Gets a channel category by its id.java.util.List<ServerChannel>getChannels()Gets a sorted list (by position) with all channels of the server.default java.util.List<ServerChannel>getChannelsByName(java.lang.String name)Gets a sorted list (by position) with all channels with the given name.default java.util.List<ServerChannel>getChannelsByNameIgnoreCase(java.lang.String name)Gets a sorted list (by position) with all channels with the given name.default java.util.Optional<ServerVoiceChannel>getConnectedVoiceChannel(long userId)Gets the voice channel the user with the given id is connected to on this server if any.default java.util.Optional<ServerVoiceChannel>getConnectedVoiceChannel(User user)Gets the voice channel the given user is connected to on this server if any.default java.util.Optional<Server>getCurrentCachedInstance()Gets an updated instance of this entity from the cache.default java.util.Optional<KnownCustomEmoji>getCustomEmojiById(long id)Gets a custom emoji in this server by its id.default java.util.Optional<KnownCustomEmoji>getCustomEmojiById(java.lang.String id)Gets a custom emoji in this server by its id.java.util.Set<KnownCustomEmoji>getCustomEmojis()Gets all custom emojis of this server.default java.util.Set<KnownCustomEmoji>getCustomEmojisByName(java.lang.String name)Gets all custom emojis with the given name in the server.default java.util.Set<KnownCustomEmoji>getCustomEmojisByNameIgnoreCase(java.lang.String name)Gets all custom emojis with the given name in the server.DefaultMessageNotificationLevelgetDefaultMessageNotificationLevel()Gets the default message notification level of the server.java.util.Optional<java.lang.String>getDescription()Gets the description of the server.java.util.Optional<Icon>getDiscoverySplash()Gets the discovery splash of the server.default java.lang.StringgetDisplayName(User user)Gets the display name of the user on this server.default RolegetEveryoneRole()Gets the @everyone role.ExplicitContentFilterLevelgetExplicitContentFilterLevel()Gets the explicit content filter level of the server.java.util.Set<ServerFeature>getFeatures()Gets the features of the server.default java.util.Optional<ServerForumChannel>getForumChannelById(long id)Gets a forum channel by its id.default java.util.Optional<ServerForumChannel>getForumChannelById(java.lang.String id)Gets a forum channel by its id.java.util.List<ServerForumChannel>getForumChannels()Gets a sorted list (by position) with all forum channels of the server.default java.util.List<ServerForumChannel>getForumChannelsByName(java.lang.String name)Gets a sorted list (by position) with all text channels with the given name.default java.util.List<ServerForumChannel>getForumChannelsByNameIgnoreCase(java.lang.String name)Gets a sorted list (by position) with all forum channels with the given name.default java.util.Optional<Role>getHighestRole(User user)Gets the highest role of the given user in this server.java.util.Optional<Icon>getIcon()Gets the icon of the server.java.util.concurrent.CompletableFuture<java.util.List<IncomingWebhook>>getIncomingWebhooks()Gets all incoming webhooks in this server.java.util.concurrent.CompletableFuture<java.util.Set<RichInvite>>getInvites()Gets the invites of the server.java.util.Optional<java.time.Instant>getJoinedAtTimestamp(User user)Gets the timestamp of when a user joined the server.java.util.Optional<java.lang.Integer>getMaxMembers()Gets the maximum number of members for the guild.java.util.Optional<java.lang.Integer>getMaxPresences()Gets the maximum number of presences for the guild (null is always returned, apart from the largest of guilds).java.util.Optional<java.lang.Integer>getMaxVideoChannelUsers()Gets the maximum amount of users in a video channel.default java.util.Optional<User>getMemberByDiscriminatedName(java.lang.String discriminatedName)Gets a member by its discriminated name like e.g.default java.util.Optional<User>getMemberByDiscriminatedNameIgnoreCase(java.lang.String discriminatedName)Gets a member by its discriminated name like e.g.java.util.Optional<User>getMemberById(long id)Gets a member by its id.default java.util.Optional<User>getMemberById(java.lang.String id)Gets a member by its id.default java.util.Optional<User>getMemberByNameAndDiscriminator(java.lang.String name, java.lang.String discriminator)Gets a member by its name and discriminator.default java.util.Optional<User>getMemberByNameAndDiscriminatorIgnoreCase(java.lang.String name, java.lang.String discriminator)Gets a member by its name and discriminator.intgetMemberCount()Gets the amount of members in this server.java.util.Set<User>getMembers()Gets all members of the server.default java.util.Set<User>getMembersByDisplayName(java.lang.String displayName)Gets all members with the given display name on this server.default java.util.Set<User>getMembersByDisplayNameIgnoreCase(java.lang.String displayName)Gets all members with the given display name on this server.default java.util.Set<User>getMembersByName(java.lang.String name)Gets all members with the given name.default java.util.Set<User>getMembersByNameIgnoreCase(java.lang.String name)Gets all members with the given name.default java.util.Set<User>getMembersByNickname(java.lang.String nickname)Gets all members with the given nickname on this server.default java.util.Set<User>getMembersByNicknameIgnoreCase(java.lang.String nickname)Gets all members with the given nickname on this server.java.util.Optional<ServerTextChannel>getModeratorsOnlyChannel()Gets the moderators-only channel (sometimes also called "public updates channel").MultiFactorAuthenticationLevelgetMultiFactorAuthenticationLevel()Gets the multi factor authentication level of the server.java.util.Optional<java.lang.String>getNickname(User user)Gets the nickname of a user.NsfwLevelgetNsfwLevel()Gets the NSFW level of the server.java.util.Optional<User>getOwner()Gets the owner of the server.longgetOwnerId()Gets the id of the server's owner.default PermissionsgetPermissions(User user)Gets the permissions of a user.java.util.LocalegetPreferredLocale()Gets the server's preferred locale.java.util.concurrent.CompletableFuture<java.lang.Integer>getPruneCount(int days)Gets the amount of members without a role which were inactive at least the given amount of days.RegiongetRegion()Gets the region of the server.java.util.Optional<RegularServerChannel>getRegularChannelById(long id)Gets a regular channel by its id.default java.util.Optional<RegularServerChannel>getRegularChannelById(java.lang.String id)Gets a regular channel by its id.java.util.List<RegularServerChannel>getRegularChannels()Gets a sorted list (by position) with all regular channels of the server.default java.util.List<RegularServerChannel>getRegularChannelsByName(java.lang.String name)Gets a sorted list (by position) with all channels with the given name.default java.util.List<RegularServerChannel>getRegularChannelsByNameIgnoreCase(java.lang.String name)Gets a sorted list (by position) with all channels with the given name.java.util.Optional<Role>getRoleById(long id)Gets a role by its id.default java.util.Optional<Role>getRoleById(java.lang.String id)Gets a role by its id.default java.util.Optional<java.awt.Color>getRoleColor(User user)Gets the displayed color of a user based on his roles on this server.java.util.List<Role>getRoles()Gets a sorted list (by position) with all roles of the server.java.util.List<Role>getRoles(User user)Gets a sorted list (by position) with all roles of the user in the server.default java.util.List<Role>getRolesByName(java.lang.String name)Gets a sorted list (by position) with all roles with the given name.default java.util.List<Role>getRolesByNameIgnoreCase(java.lang.String name)Gets a sorted list (by position) with all roles with the given name.java.util.Optional<ServerTextChannel>getRulesChannel()Gets the rules channel.java.util.Optional<java.time.Instant>getServerBoostingSinceTimestamp(User user)Gets the timestamp of when this member started boosting the server.java.util.concurrent.CompletableFuture<SlashCommand>getSlashCommandById(long commandId)Gets a server slash command by its id.java.util.concurrent.CompletableFuture<java.util.Set<SlashCommand>>getSlashCommands()Gets all slash commands for the given server.java.util.Optional<Icon>getSplash()Gets the splash of the server.default java.util.Optional<ServerStageVoiceChannel>getStageVoiceChannelById(long id)Gets a stage voice channel by its id.default java.util.Optional<ServerStageVoiceChannel>getStageVoiceChannelById(java.lang.String id)Gets a voice channel by its id.default java.util.Optional<Sticker>getStickerById(long id)Gets a sticker by its ID.default java.util.Optional<Sticker>getStickerById(java.lang.String id)Gets a sticker by its ID.java.util.Set<Sticker>getStickers()Gets the stickers of this server.default java.util.Set<Sticker>getStickersByName(java.lang.String name)Gets stickers by their name.default java.util.Set<Sticker>getStickersByNameIgnoreCase(java.lang.String name)Gets stickers by their name.java.util.Optional<ServerTextChannel>getSystemChannel()Gets the system channel of the server.java.util.EnumSet<SystemChannelFlag>getSystemChannelFlags()Gets system channel flags for this server.default java.util.Optional<ServerTextChannel>getTextChannelById(long id)Gets a text channel by its id.default java.util.Optional<ServerTextChannel>getTextChannelById(java.lang.String id)Gets a text channel by its id.java.util.List<ServerTextChannel>getTextChannels()Gets a sorted list (by position) with all text channels of the server.default java.util.List<ServerTextChannel>getTextChannelsByName(java.lang.String name)Gets a sorted list (by position) with all text channels with the given name.default java.util.List<ServerTextChannel>getTextChannelsByNameIgnoreCase(java.lang.String name)Gets a sorted list (by position) with all text channels with the given name.default java.util.Optional<ServerThreadChannel>getThreadChannelById(long id)Gets a channel thread by its id.default java.util.Optional<ServerThreadChannel>getThreadChannelById(java.lang.String id)Gets a channel thread by its id.java.util.List<ServerThreadChannel>getThreadChannels()Gets a sorted list (by archive timestamp from old to new) with all thread channels of the server.java.util.Optional<java.time.Instant>getTimeout(User user)Gets the timestamp of when the user's timeout will expire and the user will be able to communicate in the server again.default java.util.Optional<UnknownServerChannel>getUnknownChannelById(long id)Gets an unknown channel by its id.default java.util.Optional<UnknownServerChannel>getUnknownChannelById(java.lang.String id)Gets an unknown channel by its id.default java.util.Optional<UnknownRegularServerChannel>getUnknownRegularChannelById(long id)Gets an unknown regular channel by its id.default java.util.Optional<UnknownRegularServerChannel>getUnknownRegularChannelById(java.lang.String id)Gets an unknown regular channel by its id.java.util.Set<ServerChannel>getUnorderedChannels()Gets an unordered collection with all channels in the server.default java.util.Set<PermissionType>getUnsetPermissions(User user)Get the unset permissions of a given user.java.util.Optional<Icon>getUserServerAvatar(User user)Gets the user's server specific avatar.java.util.Optional<Icon>getUserServerAvatar(User user, int size)Gets the user's server specific avatar in the given size.java.util.Optional<java.lang.String>getUserServerAvatarHash(User user)Gets the user's server specific avatar hash.java.util.Optional<VanityUrlCode>getVanityUrlCode()Gets the vanity url code of the server.VerificationLevelgetVerificationLevel()Gets the verification level of the server.default java.util.List<ServerChannel>getVisibleChannels(User user)Gets a sorted (by position) list with all channels of this server the given user can see.default java.util.Optional<ServerVoiceChannel>getVoiceChannelById(long id)Gets a voice channel by its id.default java.util.Optional<ServerVoiceChannel>getVoiceChannelById(java.lang.String id)Gets a voice channel by its id.java.util.List<ServerVoiceChannel>getVoiceChannels()Gets a sorted list (by position) with all voice channels of the server.default java.util.List<ServerVoiceChannel>getVoiceChannelsByName(java.lang.String name)Gets a sorted list (by position) with all voice channels with the given name.default java.util.List<ServerVoiceChannel>getVoiceChannelsByNameIgnoreCase(java.lang.String name)Gets a sorted list (by position) with all voice channels with the given name.java.util.concurrent.CompletableFuture<java.util.List<Webhook>>getWebhooks()Gets all webhooks in this server.java.util.Optional<WelcomeScreen>getWelcomeScreen()Gets the welcome screen of a Community server shown to new members.default java.util.Optional<RegularServerChannel>getWidgetChannel()Gets regular server channel for widget.java.util.Optional<java.lang.Long>getWidgetChannelId()Gets the channel id that the widget will generate an invite to, or null if set to no invite.booleanhasAllMembersInCache()Checks if all members of the server are in the cache.default booleanhasAnyPermission(User user, PermissionType... type)Checks if the user has any of a given set of permissions.default booleanhasPermission(User user, PermissionType permission)Checks if a user has a given permission.default booleanhasPermissions(User user, PermissionType... type)Checks if the user has a given set of permissions.default booleanisAdmin(User user)Checks if the given user is an administrator of the server.booleanisDeafened(long userId)Gets the deafened state of the user with the given id.default booleanisDeafened(User user)Gets the deafened state of the given user.booleanisLarge()Checks if the server is considered large.booleanisMember(User user)Checks if the given user is a member of this server.booleanisMuted(long userId)Gets the muted state of the user with the given id.default booleanisMuted(User user)Gets the muted state of the given user.default booleanisOwner(User user)Checks if the given user is the owner of the server.booleanisPending(long userId)Gets the pending state of the user.booleanisPremiumProgressBarEnabled()True if the server's boost progress bar is enabled.booleanisSelfDeafened(long userId)Gets the self-deafened state of the user with the given id.default booleanisSelfDeafened(User user)Gets the self-deafened state of the given user.booleanisSelfMuted(long userId)Gets the self-muted state of the user with the given id.default booleanisSelfMuted(User user)Gets the self-muted state of the given user.booleanisWidgetEnabled()True if the server widget is enabled.java.util.concurrent.CompletableFuture<java.lang.Void>joinServerThreadChannel(long channelId)Joins this ServerThreadChannel.default java.util.concurrent.CompletableFuture<java.lang.Void>joinServerThreadChannel(ServerThreadChannel serverThreadChannel)Joins this ServerThreadChannel.default java.util.concurrent.CompletableFuture<java.lang.Void>kickUser(User user)Kicks the given user from the server.java.util.concurrent.CompletableFuture<java.lang.Void>kickUser(User user, java.lang.String reason)Kicks the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>kickUserFromVoiceChannel(User user)Kicks the given user from any voice channel.java.util.concurrent.CompletableFuture<java.lang.Void>leave()Leaves the server.java.util.concurrent.CompletableFuture<java.lang.Void>leaveServerThreadChannel(long channelId)Leaves this ServerThreadChannel.default java.util.concurrent.CompletableFuture<java.lang.Void>leaveServerThreadChannel(ServerThreadChannel serverThreadChannel)Leaves this ServerThreadChannel.default java.util.concurrent.CompletableFuture<java.lang.Void>moveUser(User user, ServerVoiceChannel channel)Moves the given user to the given channel on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>moveYourself(ServerVoiceChannel channel)Moves yourself to the given channel on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>muteUser(User user)Mutes the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>muteUser(User user, java.lang.String reason)Mutes the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>muteYourself()Mutes yourself on the server.default java.util.concurrent.CompletableFuture<java.lang.Integer>pruneMembers(int days)Kicks all members without a role which were inactive at least the given amount of days.java.util.concurrent.CompletableFuture<java.lang.Integer>pruneMembers(int days, java.lang.String reason)Kicks all members without a role which were inactive at least the given amount of days.default java.util.concurrent.CompletableFuture<java.lang.Void>removeAfkChannel()Removes the afk channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeBanner()Removes the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeIcon()Removes the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeModeratorsOnlyChannel()Removes the moderators-only channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeRoleFromUser(User user, Role role)Removes the given role from the given server member.java.util.concurrent.CompletableFuture<java.lang.Void>removeRoleFromUser(User user, Role role, java.lang.String reason)Removes the given role from the given server member.default java.util.concurrent.CompletableFuture<java.lang.Void>removeRulesChannel()Removes the rules channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeSplash()Removes the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeSystemChannel()Removes the system channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeUserTimeout(User user)Remove a timeout for the given user on this server.default java.util.concurrent.CompletableFuture<java.lang.Void>removeUserTimeout(User user, java.lang.String reason)Remove a timeout for the given user on this server.default java.util.concurrent.CompletableFuture<java.lang.Void>reorderRoles(java.util.List<Role> roles)Reorders the roles of the server.java.util.concurrent.CompletableFuture<java.lang.Void>reorderRoles(java.util.List<Role> roles, java.lang.String reason)Reorders the roles of the server.java.util.concurrent.CompletableFuture<Ban>requestBan(long userId)Requests a ban object for the specified user.default java.util.concurrent.CompletableFuture<Ban>requestBan(User user)Requests a ban object for the specified user.java.util.concurrent.CompletableFuture<User>requestMember(long userId)Requests a server member.default java.util.concurrent.CompletableFuture<User>requestMember(User user)Requests a server member.voidrequestMembersChunks()Requests Discord to send the members for this server.default java.util.concurrent.CompletableFuture<User>requestOwner()Gets the owner of the server.java.util.concurrent.CompletableFuture<Sticker>requestStickerById(long id)Requests a sticker by its ID from the Discord API without checking the cache.default java.util.concurrent.CompletableFuture<Sticker>requestStickerById(java.lang.String id)Requests a sticker by its ID from the Discord API without checking the cache.java.util.concurrent.CompletableFuture<java.util.Set<Sticker>>requestStickers()Requests the sticker of this server from the Discord API without checking the cache.default java.util.concurrent.CompletableFuture<java.lang.Void>resetNickname(User user)Removes the nickname of the given user.default java.util.concurrent.CompletableFuture<java.lang.Void>resetNickname(User user, java.lang.String reason)Removes the nickname of the given user.voidselfDeafen()Deafens yourself locally for the server.voidselfMute()Mutes yourself locally for the server.voidselfUndeafen()Undeafens yourself locally for the server.voidselfUnmute()Unmutes yourself locally for the server.default java.util.concurrent.CompletableFuture<java.lang.Void>setModeratorsOnlyChannel(ServerTextChannel moderatorsOnlyChannel)Updates the moderators-only channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>setRulesChannel(ServerTextChannel rulesChannel)Updates the rules channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>setSystemChannel(ServerTextChannel systemChannel)Updates the system channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>timeoutUser(User user, java.time.Duration duration)Timeout the given user on this server.default java.util.concurrent.CompletableFuture<java.lang.Void>timeoutUser(User user, java.time.Duration duration, java.lang.String reason)Timeout the given user on this server.default java.util.concurrent.CompletableFuture<java.lang.Void>timeoutUser(User user, java.time.Instant timeout)Timeout the given user on this server.default java.util.concurrent.CompletableFuture<java.lang.Void>timeoutUser(User user, java.time.Instant timeout, java.lang.String reason)Timeout the given user on this server.default java.util.concurrent.CompletableFuture<java.lang.Void>unbanUser(long userId)Unbans the given user from the server.java.util.concurrent.CompletableFuture<java.lang.Void>unbanUser(long userId, java.lang.String reason)Unbans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>unbanUser(java.lang.String userId)Unbans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>unbanUser(java.lang.String userId, java.lang.String reason)Unbans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>unbanUser(User user)Unbans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>unbanUser(User user, java.lang.String reason)Unbans the given user from the server.default java.util.concurrent.CompletableFuture<java.lang.Void>undeafenUser(User user)Undeafens the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>undeafenUser(User user, java.lang.String reason)Undeafens the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>undeafenYourself()Undeafens yourself on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>unmuteUser(User user)Unmutes the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>unmuteUser(User user, java.lang.String reason)Unmutes the given user on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>unmuteYourself()Unmutes yourself on the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAfkChannel(ServerVoiceChannel afkChannel)Updates the afk channel of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateAfkTimeoutInSeconds(int afkTimeout)Updates the afk timeout of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(byte[] banner)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(byte[] banner, java.lang.String fileType)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(java.awt.image.BufferedImage banner)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(java.awt.image.BufferedImage banner, java.lang.String fileType)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(java.io.File banner)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(java.io.InputStream banner)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(java.io.InputStream banner, java.lang.String fileType)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(java.net.URL banner)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateBanner(Icon banner)Updates the banner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateDefaultMessageNotificationLevel(DefaultMessageNotificationLevel defaultMessageNotificationLevel)Updates the default message notification level of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateExplicitContentFilterLevel(ExplicitContentFilterLevel explicitContentFilterLevel)Updates the explicit content filter level of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(byte[] icon)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(byte[] icon, java.lang.String fileType)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(java.awt.image.BufferedImage icon)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(java.awt.image.BufferedImage icon, java.lang.String fileType)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(java.io.File icon)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(java.io.InputStream icon)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(java.io.InputStream icon, java.lang.String fileType)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(java.net.URL icon)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateIcon(Icon icon)Updates the icon of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateName(java.lang.String name)Updates the name of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateNickname(User user, java.lang.String nickname)Changes the nickname of the given user.default java.util.concurrent.CompletableFuture<java.lang.Void>updateNickname(User user, java.lang.String nickname, java.lang.String reason)Changes the nickname of the given user.default java.util.concurrent.CompletableFuture<java.lang.Void>updateOwner(User owner)Updates the owner of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updatePreferredLocale(java.util.Locale locale)Updates the locale of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateRegion(Region region)Updates the region of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateRoles(User user, java.util.Collection<Role> roles)Updates the roles of a server member.default java.util.concurrent.CompletableFuture<java.lang.Void>updateRoles(User user, java.util.Collection<Role> roles, java.lang.String reason)Updates the roles of a server member.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(byte[] splash)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(byte[] splash, java.lang.String fileType)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(java.awt.image.BufferedImage splash)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(java.awt.image.BufferedImage splash, java.lang.String fileType)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(java.io.File splash)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(java.io.InputStream splash)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(java.io.InputStream splash, java.lang.String fileType)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(java.net.URL splash)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateSplash(Icon splash)Updates the splash of the server.default java.util.concurrent.CompletableFuture<java.lang.Void>updateVerificationLevel(VerificationLevel verificationLevel)Updates the verification level of the server.-
Methods inherited from interface org.javacord.api.entity.Deletable
delete, delete, deleteAfter, deleteAfter, deleteAfter, deleteAfter, getApi
-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getId, getIdAsString
-
Methods inherited from interface org.javacord.api.listener.server.ServerAttachableListenerManager
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.UpdatableFromCache
getLatestInstance
-
-
-
-
Method Detail
-
getAudioConnection
java.util.Optional<AudioConnection> getAudioConnection()
Gets the audio connection in this server.- Returns:
- The audio connection in this server.
-
getFeatures
java.util.Set<ServerFeature> getFeatures()
Gets the features of the server.- Returns:
- The server's available features.
-
getBoostLevel
BoostLevel getBoostLevel()
Gets the boost level of the server.- Returns:
- The boost level.
-
getBoostCount
int getBoostCount()
Gets the boost count of the server.- Returns:
- The boost count.
-
getRulesChannel
java.util.Optional<ServerTextChannel> getRulesChannel()
Gets the rules channel.Rule channels are only available for public servers. You can check if a server is public using the
getFeatures()methods.- Returns:
- The rules channel.
-
getDescription
java.util.Optional<java.lang.String> getDescription()
Gets the description of the server.- Returns:
- The description.
-
getNsfwLevel
NsfwLevel getNsfwLevel()
Gets the NSFW level of the server.- Returns:
- The NSFW level of the server.
-
getModeratorsOnlyChannel
java.util.Optional<ServerTextChannel> getModeratorsOnlyChannel()
Gets the moderators-only channel (sometimes also called "public updates channel").This is the channel where Discord will send announcements and updates relevant to Public server admins and moderators, like new moderation features and the server's eligibility in Discovery.
Moderator-only channels are only available for public servers. You can check if a server is public using the
getFeatures()method.- Returns:
- The moderators-only channel.
-
getVanityUrlCode
java.util.Optional<VanityUrlCode> getVanityUrlCode()
Gets the vanity url code of the server.- Returns:
- The vanity url code.
-
getDiscoverySplash
java.util.Optional<Icon> getDiscoverySplash()
Gets the discovery splash of the server.- Returns:
- The discovery splash.
-
getPreferredLocale
java.util.Locale getPreferredLocale()
Gets the server's preferred locale.Discord will prioritize this server in Discovery to users who speak the selected language. Updates sent from Discord in the Moderators-only channel will also be in this language.
Setting a preferred locale is only available for public servers. You can check if a server is public using the
getFeatures()methods.- Returns:
- The severs preferred locale.
-
getRegion
Region getRegion()
Gets the region of the server.- Returns:
- The region of the server.
-
getNickname
java.util.Optional<java.lang.String> getNickname(User user)
Gets the nickname of a user.- Parameters:
user- The user to check.- Returns:
- The nickname of the user.
-
getServerBoostingSinceTimestamp
java.util.Optional<java.time.Instant> getServerBoostingSinceTimestamp(User user)
Gets the timestamp of when this member started boosting the server.- Parameters:
user- The user to check.- Returns:
- The timestamp of when this member started boosting the server.
-
getTimeout
java.util.Optional<java.time.Instant> getTimeout(User user)
Gets the timestamp of when the user's timeout will expire and the user will be able to communicate in the server again. The returned Instant may be in the past which indicates that the user is not timed out.- Parameters:
user- The user to check.- Returns:
- The timestamp of when this user will no longer be timed out. Empty or a timestamp in the past, if user is currently not timed out.
-
getActiveTimeout
default java.util.Optional<java.time.Instant> getActiveTimeout(User user)
Gets the timestamp of when the user's timeout will expire and the user will be able to communicate in the server again. The returned Instant will be checked againstInstant.now()and will only return an Instant, if the timeout is active at the moment when this method is called.- Parameters:
user- The user to check.- Returns:
- The timestamp of when this user will no longer be timed out.
-
getUserServerAvatarHash
java.util.Optional<java.lang.String> getUserServerAvatarHash(User user)
Gets the user's server specific avatar hash.- Parameters:
user- The user.- Returns:
- The user's server specific avatar hash.
-
getUserServerAvatar
java.util.Optional<Icon> getUserServerAvatar(User user)
Gets the user's server specific avatar.- Parameters:
user- The user.- Returns:
- The user's server specific avatar.
-
getUserServerAvatar
java.util.Optional<Icon> getUserServerAvatar(User user, int size)
Gets the user's server specific avatar in the given size.- Parameters:
user- The user.size- The size of the image, must be any power of 2 between 16 and 4096.- Returns:
- The user's server specific avatar in the given size.
-
isPending
boolean isPending(long userId)
Gets the pending state of the user.Membership screening pending state is only available for servers that have verification gate enabled, this will default to false if it isn't. You can check if a server has membership verification gate enabled using the
getFeatures()method if it hasServerFeature.MEMBER_VERIFICATION_GATE_ENABLED.- Parameters:
userId- The id of the user to check.- Returns:
- Whether the user has passed membership screening
-
areYouSelfMuted
default boolean areYouSelfMuted()
Gets your self-muted state.- Returns:
- Whether you are self-muted.
-
isSelfMuted
boolean isSelfMuted(long userId)
Gets the self-muted state of the user with the given id.- Parameters:
userId- The id of the user to check.- Returns:
- Whether the user with the given id is self-muted.
-
isSelfMuted
default boolean isSelfMuted(User user)
Gets the self-muted state of the given user.- Parameters:
user- The user to check.- Returns:
- Whether the given user is self-muted.
-
areYouSelfDeafened
default boolean areYouSelfDeafened()
Gets your self-deafened state.- Returns:
- Whether you are self-deafened.
-
isSelfDeafened
boolean isSelfDeafened(long userId)
Gets the self-deafened state of the user with the given id.- Parameters:
userId- The id of the user to check.- Returns:
- Whether the user with the given id is self-deafened.
-
isSelfDeafened
default boolean isSelfDeafened(User user)
Gets the self-deafened state of the given user.- Parameters:
user- The user to check.- Returns:
- Whether the given user is self-deafened.
-
areYouMuted
default boolean areYouMuted()
Gets your muted state.- Returns:
- Whether you are muted.
-
isMuted
boolean isMuted(long userId)
Gets the muted state of the user with the given id.- Parameters:
userId- The id of the user to check.- Returns:
- Whether the user with the given id is muted.
-
isMuted
default boolean isMuted(User user)
Gets the muted state of the given user.- Parameters:
user- The user to check.- Returns:
- Whether the given user is muted.
-
areYouDeafened
default boolean areYouDeafened()
Gets your deafened state.- Returns:
- Whether you are deafened.
-
isDeafened
boolean isDeafened(long userId)
Gets the deafened state of the user with the given id.- Parameters:
userId- The id of the user to check.- Returns:
- Whether the user with the given id is deafened.
-
isDeafened
default boolean isDeafened(User user)
Gets the deafened state of the given user.- Parameters:
user- The user to check.- Returns:
- Whether the given user is deafened.
-
getDisplayName
default java.lang.String getDisplayName(User user)
Gets the display name of the user on this server. If the user has a nickname, it will return the nickname, otherwise it will return the "normal" name.- Parameters:
user- The user.- Returns:
- The display name of the user on this server.
-
getJoinedAtTimestamp
java.util.Optional<java.time.Instant> getJoinedAtTimestamp(User user)
Gets the timestamp of when a user joined the server.- Parameters:
user- The user to check.- Returns:
- The timestamp of when the user joined the server.
-
isLarge
boolean isLarge()
Checks if the server is considered large.- Returns:
- Whether the server is large or not.
-
getMemberCount
int getMemberCount()
Gets the amount of members in this server.- Returns:
- The amount of members in this server.
-
getOwner
java.util.Optional<User> getOwner()
Gets the owner of the server.- Returns:
- The owner of the server.
-
requestOwner
default java.util.concurrent.CompletableFuture<User> requestOwner()
Gets the owner of the server.If the owner is in the cache, the owner is served from the cache.
- Returns:
- The owner of the server.
-
getOwnerId
long getOwnerId()
Gets the id of the server's owner.- Returns:
- The owner's id.
-
getApplicationId
java.util.Optional<java.lang.Long> getApplicationId()
Gets the application id of the server's owner. The application id is only present for bot-created servers.- Returns:
- The application id of the server's owner.
-
getVerificationLevel
VerificationLevel getVerificationLevel()
Gets the verification level of the server.- Returns:
- The verification level of the server.
-
getExplicitContentFilterLevel
ExplicitContentFilterLevel getExplicitContentFilterLevel()
Gets the explicit content filter level of the server.- Returns:
- The explicit content filter level of the server.
-
getDefaultMessageNotificationLevel
DefaultMessageNotificationLevel getDefaultMessageNotificationLevel()
Gets the default message notification level of the server.- Returns:
- The default message notification level of the server.
-
getMultiFactorAuthenticationLevel
MultiFactorAuthenticationLevel getMultiFactorAuthenticationLevel()
Gets the multi factor authentication level of the server.- Returns:
- The multi factor authentication level of the server.
-
getIcon
java.util.Optional<Icon> getIcon()
Gets the icon of the server.- Returns:
- The icon of the server.
-
getSplash
java.util.Optional<Icon> getSplash()
Gets the splash of the server.- Returns:
- The splash of the server.
-
getSystemChannel
java.util.Optional<ServerTextChannel> getSystemChannel()
Gets the system channel of the server.- Returns:
- The system channel of the server.
-
getAfkChannel
java.util.Optional<ServerVoiceChannel> getAfkChannel()
Gets the afk channel of the server.- Returns:
- The afk channel of the server.
-
getAfkTimeoutInSeconds
int getAfkTimeoutInSeconds()
Gets the afk timeout in seconds of the server.- Returns:
- The afk timeout in seconds of the server.
-
getPruneCount
java.util.concurrent.CompletableFuture<java.lang.Integer> getPruneCount(int days)
Gets the amount of members without a role which were inactive at least the given amount of days.- Parameters:
days- The amount of days the member has to be inactive.- Returns:
- The amount of member who would get kicked.
-
pruneMembers
default java.util.concurrent.CompletableFuture<java.lang.Integer> pruneMembers(int days)
Kicks all members without a role which were inactive at least the given amount of days.- Parameters:
days- The amount of days the member has to be inactive.- Returns:
- The amount of member who got kicked.
-
pruneMembers
java.util.concurrent.CompletableFuture<java.lang.Integer> pruneMembers(int days, java.lang.String reason)Kicks all members without a role which were inactive at least the given amount of days.- Parameters:
days- The amount of days the member has to be inactive.reason- The audit log reason for the prune.- Returns:
- The amount of member who got kicked.
-
getInvites
java.util.concurrent.CompletableFuture<java.util.Set<RichInvite>> getInvites()
Gets the invites of the server.- Returns:
- The invites of the server.
-
hasAllMembersInCache
boolean hasAllMembersInCache()
Checks if all members of the server are in the cache.- Returns:
- Whether all members of the server are in the cache.
-
requestMembersChunks
void requestMembersChunks()
Requests Discord to send the members for this server.After calling this method, your bot will receive
ServerMembersChunkEvents.
-
getMembers
java.util.Set<User> getMembers()
Gets all members of the server.- Returns:
- All members of the server.
-
getMemberById
java.util.Optional<User> getMemberById(long id)
Gets a member by its id.- Parameters:
id- The id of the member.- Returns:
- The member with the given id.
-
getMemberById
default java.util.Optional<User> getMemberById(java.lang.String id)
Gets a member by its id.- Parameters:
id- The id of the member.- Returns:
- The member with the given id.
-
getMemberByDiscriminatedName
default java.util.Optional<User> getMemberByDiscriminatedName(java.lang.String discriminatedName)
Gets a member by its discriminated name like e.g.Bastian#8222. This method is case-sensitive!- Parameters:
discriminatedName- The discriminated name of the member.- Returns:
- The member with the given discriminated name.
-
getMemberByDiscriminatedNameIgnoreCase
default java.util.Optional<User> getMemberByDiscriminatedNameIgnoreCase(java.lang.String discriminatedName)
Gets a member by its discriminated name like e.g.Bastian#8222. This method is case-insensitive!- Parameters:
discriminatedName- The discriminated name of the member.- Returns:
- The member with the given discriminated name.
-
getMemberByNameAndDiscriminator
default java.util.Optional<User> getMemberByNameAndDiscriminator(java.lang.String name, java.lang.String discriminator)
Gets a member by its name and discriminator. This method is case-sensitive!- Parameters:
name- The name of the member.discriminator- The discriminator of the member.- Returns:
- The member with the given name and discriminator.
-
getMemberByNameAndDiscriminatorIgnoreCase
default java.util.Optional<User> getMemberByNameAndDiscriminatorIgnoreCase(java.lang.String name, java.lang.String discriminator)
Gets a member by its name and discriminator. This method is case-insensitive!- Parameters:
name- The name of the member.discriminator- The discriminator of the member.- Returns:
- The member with the given name and discriminator.
-
getMembersByName
default java.util.Set<User> getMembersByName(java.lang.String name)
Gets all members with the given name. This method is case-sensitive!- Parameters:
name- The name of the members.- Returns:
- All members with the given name.
-
getMembersByNameIgnoreCase
default java.util.Set<User> getMembersByNameIgnoreCase(java.lang.String name)
Gets all members with the given name. This method is case-insensitive!- Parameters:
name- The name of the members.- Returns:
- All members with the given name.
-
getMembersByNickname
default java.util.Set<User> getMembersByNickname(java.lang.String nickname)
Gets all members with the given nickname on this server. This method is case-sensitive!- Parameters:
nickname- The nickname of the members.- Returns:
- All members with the given nickname on this server.
-
getMembersByNicknameIgnoreCase
default java.util.Set<User> getMembersByNicknameIgnoreCase(java.lang.String nickname)
Gets all members with the given nickname on this server. This method is case-insensitive!- Parameters:
nickname- The nickname of the members.- Returns:
- All members with the given nickname on this server.
-
getMembersByDisplayName
default java.util.Set<User> getMembersByDisplayName(java.lang.String displayName)
Gets all members with the given display name on this server. This method is case-sensitive!- Parameters:
displayName- The display name of the members.- Returns:
- All members with the given display name on this server.
-
getMembersByDisplayNameIgnoreCase
default java.util.Set<User> getMembersByDisplayNameIgnoreCase(java.lang.String displayName)
Gets all members with the given display name on this server. This method is case-insensitive!- Parameters:
displayName- The display name of the members.- Returns:
- All members with the given display name on this server.
-
isMember
boolean isMember(User user)
Checks if the given user is a member of this server.- Parameters:
user- The user to check.- Returns:
- If the user is a member of this server.
-
getRoles
java.util.List<Role> getRoles()
Gets a sorted list (by position) with all roles of the server.- Returns:
- A sorted list (by position) with all roles of the server.
-
getRoles
java.util.List<Role> getRoles(User user)
Gets a sorted list (by position) with all roles of the user in the server.- Parameters:
user- The user.- Returns:
- A sorted list (by position) with all roles of the user in the server.
-
getRoleById
java.util.Optional<Role> getRoleById(long id)
Gets a role by its id.- Parameters:
id- The id of the role.- Returns:
- The role with the given id.
-
getRoleById
default java.util.Optional<Role> getRoleById(java.lang.String id)
Gets a role by its id.- Parameters:
id- The id of the role.- Returns:
- The role with the given id.
-
getEveryoneRole
default Role getEveryoneRole()
Gets the @everyone role.- Returns:
- The @everyone role.
-
getRolesByName
default java.util.List<Role> getRolesByName(java.lang.String name)
Gets a sorted list (by position) with all roles with the given name. This method is case-sensitive!- Parameters:
name- The name of the roles.- Returns:
- A sorted list (by position) with all roles with the given name.
-
getRolesByNameIgnoreCase
default java.util.List<Role> getRolesByNameIgnoreCase(java.lang.String name)
Gets a sorted list (by position) with all roles with the given name. This method is case-insensitive!- Parameters:
name- The name of the roles.- Returns:
- A sorted list (by position) with all roles with the given name.
-
getRoleColor
default java.util.Optional<java.awt.Color> getRoleColor(User user)
Gets the displayed color of a user based on his roles on this server.- Parameters:
user- The user.- Returns:
- The color.
-
getPermissions
default Permissions getPermissions(User user)
Gets the permissions of a user.- Parameters:
user- The user.- Returns:
- The permissions of the user.
-
getAllowedPermissions
default java.util.Set<PermissionType> getAllowedPermissions(User user)
Get the allowed permissions of a given user. Remember, that some permissions affect others! E.g. a user who hasPermissionType.SEND_MESSAGESbut notPermissionType.VIEW_CHANNELcannot send messages, even though he has thePermissionType.SEND_MESSAGESpermission.- Parameters:
user- The user.- Returns:
- The allowed permissions of the given user.
-
getUnsetPermissions
default java.util.Set<PermissionType> getUnsetPermissions(User user)
Get the unset permissions of a given user.- Parameters:
user- The user.- Returns:
- The unset permissions of the given user.
-
hasPermissions
default boolean hasPermissions(User user, PermissionType... type)
Checks if the user has a given set of permissions.- Parameters:
user- The user to check.type- The permission type(s) to check.- Returns:
- Whether the user has all given permissions or not.
- See Also:
getAllowedPermissions(User)
-
hasAnyPermission
default boolean hasAnyPermission(User user, PermissionType... type)
Checks if the user has any of a given set of permissions.- Parameters:
user- The user to check.type- The permission type(s) to check.- Returns:
- Whether the user has any of the given permissions or not.
- See Also:
getAllowedPermissions(User)
-
createCustomEmojiBuilder
default CustomEmojiBuilder createCustomEmojiBuilder()
Creates a custom emoji builder to create custom emojis.- Returns:
- A custom emoji builder to create custom emojis.
-
createUpdater
default ServerUpdater createUpdater()
Creates an updater for this server.- Returns:
- An updater for this server.
-
updateName
default java.util.concurrent.CompletableFuture<java.lang.Void> updateName(java.lang.String name)
Updates the name of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
name- The new name of the server.- Returns:
- A future to check if the update was successful.
-
updateRegion
default java.util.concurrent.CompletableFuture<java.lang.Void> updateRegion(Region region)
Updates the region of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
region- The new region of the server.- Returns:
- A future to check if the update was successful.
-
updateExplicitContentFilterLevel
default java.util.concurrent.CompletableFuture<java.lang.Void> updateExplicitContentFilterLevel(ExplicitContentFilterLevel explicitContentFilterLevel)
Updates the explicit content filter level of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
explicitContentFilterLevel- The new explicit content filter level of the server.- Returns:
- A future to check if the update was successful.
-
updateVerificationLevel
default java.util.concurrent.CompletableFuture<java.lang.Void> updateVerificationLevel(VerificationLevel verificationLevel)
Updates the verification level of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
verificationLevel- The new verification level of the server.- Returns:
- A future to check if the update was successful.
-
updateDefaultMessageNotificationLevel
default java.util.concurrent.CompletableFuture<java.lang.Void> updateDefaultMessageNotificationLevel(DefaultMessageNotificationLevel defaultMessageNotificationLevel)
Updates the default message notification level of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
defaultMessageNotificationLevel- The new default message notification level of the server.- Returns:
- A future to check if the update was successful.
-
updateAfkChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAfkChannel(ServerVoiceChannel afkChannel)
Updates the afk channel of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
afkChannel- The new afk channel of the server.- Returns:
- A future to check if the update was successful.
-
removeAfkChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> removeAfkChannel()
Removes the afk channel of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the update was successful.
-
updateAfkTimeoutInSeconds
default java.util.concurrent.CompletableFuture<java.lang.Void> updateAfkTimeoutInSeconds(int afkTimeout)
Updates the afk timeout of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
afkTimeout- The new afk timeout of the server in seconds.- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(java.awt.image.BufferedImage icon)
Updates the icon of the server. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(java.awt.image.BufferedImage icon, java.lang.String fileType)Updates the icon of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.fileType- The type of the icon, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(java.io.File icon)
Updates the icon of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(Icon icon)
Updates the icon of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(java.net.URL icon)
Updates the icon of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(byte[] icon)
Updates the icon of the server. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(byte[] icon, java.lang.String fileType)Updates the icon of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.fileType- The type of the icon, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(java.io.InputStream icon)
Updates the icon of the server. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.- Returns:
- A future to check if the update was successful.
-
updateIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> updateIcon(java.io.InputStream icon, java.lang.String fileType)Updates the icon of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
icon- The new icon of the server.fileType- The type of the icon, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
removeIcon
default java.util.concurrent.CompletableFuture<java.lang.Void> removeIcon()
Removes the icon of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the removal was successful.
-
updateOwner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateOwner(User owner)
Updates the owner of the server. You must be the owner of this server in order to transfer it!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
owner- The new owner of the server.- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(java.awt.image.BufferedImage splash)
Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(java.awt.image.BufferedImage splash, java.lang.String fileType)Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.fileType- The type of the splash, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(java.io.File splash)
Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(Icon splash)
Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(java.net.URL splash)
Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(byte[] splash)
Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(byte[] splash, java.lang.String fileType)Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.fileType- The type of the splash, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(java.io.InputStream splash)
Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.- Returns:
- A future to check if the update was successful.
-
updateSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> updateSplash(java.io.InputStream splash, java.lang.String fileType)Updates the splash of the server. RequiresServerFeature.INVITE_SPLASH.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
splash- The new splash of the server.fileType- The type of the splash, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
removeSplash
default java.util.concurrent.CompletableFuture<java.lang.Void> removeSplash()
Removes the splash of the server. RequiresServerFeature.INVITE_SPLASH.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the removal was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(java.awt.image.BufferedImage banner)
Updates the banner of the server. RequiresServerFeature.BANNER. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(java.awt.image.BufferedImage banner, java.lang.String fileType)Updates the banner of the server. RequiresServerFeature.BANNER.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.fileType- The type of the banner, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(java.io.File banner)
Updates the banner of the server. RequiresServerFeature.BANNER.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server. RequiresServerFeature.BANNER.- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(Icon banner)
Updates the banner of the server. RequiresServerFeature.BANNER.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(java.net.URL banner)
Updates the banner of the server. RequiresServerFeature.BANNER.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(byte[] banner)
Updates the banner of the server. RequiresServerFeature.BANNER. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(byte[] banner, java.lang.String fileType)Updates the banner of the server. RequiresServerFeature.BANNER.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.fileType- The type of the banner, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(java.io.InputStream banner)
Updates the banner of the server. RequiresServerFeature.BANNER. This method assumes the file type is "png"!If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.- Returns:
- A future to check if the update was successful.
-
updateBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> updateBanner(java.io.InputStream banner, java.lang.String fileType)Updates the banner of the server. RequiresServerFeature.BANNER.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
banner- The new banner of the server.fileType- The type of the banner, e.g. "png" or "jpg".- Returns:
- A future to check if the update was successful.
-
removeBanner
default java.util.concurrent.CompletableFuture<java.lang.Void> removeBanner()
Removes the banner of the server. RequiresServerFeature.BANNER.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the removal was successful.
-
setRulesChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> setRulesChannel(ServerTextChannel rulesChannel)
Updates the rules channel of the server. Server has to be "PUBLIC".If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
rulesChannel- The new rules channel of the server.- Returns:
- A future to check if the update was successful.
-
removeRulesChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> removeRulesChannel()
Removes the rules channel of the server. Server has to be "PUBLIC".If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the update was successful.
-
setModeratorsOnlyChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> setModeratorsOnlyChannel(ServerTextChannel moderatorsOnlyChannel)
Updates the moderators-only channel of the server. Server has to be "PUBLIC".If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
moderatorsOnlyChannel- The new moderators-only of the server.- Returns:
- A future to check if the update was successful.
-
removeModeratorsOnlyChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> removeModeratorsOnlyChannel()
Removes the moderators-only channel of the server. Server has to be "PUBLIC".If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the update was successful.
-
updatePreferredLocale
default java.util.concurrent.CompletableFuture<java.lang.Void> updatePreferredLocale(java.util.Locale locale)
Updates the locale of the server. Server has to be "PUBLIC".If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
locale- The new locale of the server.- Returns:
- A future to check if the update was successful.
-
setSystemChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> setSystemChannel(ServerTextChannel systemChannel)
Updates the system channel of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
systemChannel- The new system channel of the server.- Returns:
- A future to check if the update was successful.
-
removeSystemChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> removeSystemChannel()
Removes the system channel of the server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Returns:
- A future to check if the update was successful.
-
updateNickname
default java.util.concurrent.CompletableFuture<java.lang.Void> updateNickname(User user, java.lang.String nickname)
Changes the nickname of the given user.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.nickname- The new nickname of the user.- Returns:
- A future to check if the update was successful.
-
updateNickname
default java.util.concurrent.CompletableFuture<java.lang.Void> updateNickname(User user, java.lang.String nickname, java.lang.String reason)
Changes the nickname of the given user.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.nickname- The new nickname of the user.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
resetNickname
default java.util.concurrent.CompletableFuture<java.lang.Void> resetNickname(User user)
Removes the nickname of the given user.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.- Returns:
- A future to check if the update was successful.
-
resetNickname
default java.util.concurrent.CompletableFuture<java.lang.Void> resetNickname(User user, java.lang.String reason)
Removes the nickname of the given user.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
timeoutUser
default java.util.concurrent.CompletableFuture<java.lang.Void> timeoutUser(User user, java.time.Instant timeout)
Timeout the given user on this server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.timeout- The timestamp until the user should be timed out.- Returns:
- A future to check if the update was successful.
-
timeoutUser
default java.util.concurrent.CompletableFuture<java.lang.Void> timeoutUser(User user, java.time.Instant timeout, java.lang.String reason)
Timeout the given user on this server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.timeout- The timestamp until the user should be timed out.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
timeoutUser
default java.util.concurrent.CompletableFuture<java.lang.Void> timeoutUser(User user, java.time.Duration duration)
Timeout the given user on this server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.duration- The duration of the timeout.- Returns:
- A future to check if the update was successful.
-
timeoutUser
default java.util.concurrent.CompletableFuture<java.lang.Void> timeoutUser(User user, java.time.Duration duration, java.lang.String reason)
Timeout the given user on this server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.duration- The duration of the timeout.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
removeUserTimeout
default java.util.concurrent.CompletableFuture<java.lang.Void> removeUserTimeout(User user)
Remove a timeout for the given user on this server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.- Returns:
- A future to check if the update was successful.
-
removeUserTimeout
default java.util.concurrent.CompletableFuture<java.lang.Void> removeUserTimeout(User user, java.lang.String reason)
Remove a timeout for the given user on this server.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
leave
java.util.concurrent.CompletableFuture<java.lang.Void> leave()
Leaves the server.- Returns:
- A future to check if the bot successfully left the server.
-
addRoleToUser
default java.util.concurrent.CompletableFuture<java.lang.Void> addRoleToUser(User user, Role role)
Adds the given role to the given server member.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The server member the role should be added to.role- The role which should be added to the server member.- Returns:
- A future to check if the update was successful.
-
addRoleToUser
java.util.concurrent.CompletableFuture<java.lang.Void> addRoleToUser(User user, Role role, java.lang.String reason)
Adds the given role to the given server member.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The server member the role should be added to.role- The role which should be added to the server member.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
removeRoleFromUser
default java.util.concurrent.CompletableFuture<java.lang.Void> removeRoleFromUser(User user, Role role)
Removes the given role from the given server member.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The server member the role should be removed from.role- The role which should be removed from the server member.- Returns:
- A future to check if the update was successful.
-
removeRoleFromUser
java.util.concurrent.CompletableFuture<java.lang.Void> removeRoleFromUser(User user, Role role, java.lang.String reason)
Removes the given role from the given server member.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The server member the role should be removed from.role- The role which should be removed from the server member.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
updateRoles
default java.util.concurrent.CompletableFuture<java.lang.Void> updateRoles(User user, java.util.Collection<Role> roles)
Updates the roles of a server member. This will replace the roles of the server member with a provided collection.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user to update the roles of.roles- The collection of roles to replace the user's roles.- Returns:
- A future to check if the update was successful.
-
updateRoles
default java.util.concurrent.CompletableFuture<java.lang.Void> updateRoles(User user, java.util.Collection<Role> roles, java.lang.String reason)
Updates the roles of a server member. This will replace the roles of the server member with a provided collection.If you want to update several settings at once, it's recommended to use the
ServerUpdaterfromcreateUpdater()which provides a better performance!- Parameters:
user- The user to update the roles of.roles- The collection of roles to replace the user's roles.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
reorderRoles
default java.util.concurrent.CompletableFuture<java.lang.Void> reorderRoles(java.util.List<Role> roles)
Reorders the roles of the server.- Parameters:
roles- An ordered list with the new role positions.- Returns:
- A future to check if the update was successful.
-
reorderRoles
java.util.concurrent.CompletableFuture<java.lang.Void> reorderRoles(java.util.List<Role> roles, java.lang.String reason)
Reorders the roles of the server.- Parameters:
roles- An ordered list with the new role positions.reason- The audit log reason for this update.- Returns:
- A future to check if the update was successful.
-
moveYourself
default java.util.concurrent.CompletableFuture<java.lang.Void> moveYourself(ServerVoiceChannel channel)
Moves yourself to the given channel on the server.- Parameters:
channel- The channel to move the user to.- Returns:
- A future to check if the move was successful.
-
moveUser
default java.util.concurrent.CompletableFuture<java.lang.Void> moveUser(User user, ServerVoiceChannel channel)
Moves the given user to the given channel on the server.- Parameters:
user- The user to move.channel- The channel to move the user to.- Returns:
- A future to check if the move was successful.
-
kickUserFromVoiceChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> kickUserFromVoiceChannel(User user)
Kicks the given user from any voice channel.- Parameters:
user- The user to kick.- Returns:
- A future to check if the kick was successful.
-
selfMute
void selfMute()
Mutes yourself locally for the server.This cannot be undone by other users. If you want to mute yourself server-side, so that others can unmute you, use
muteYourself(),muteUser(User)ormuteUser(User, String).- See Also:
muteYourself(),muteUser(User),muteUser(User, String)
-
selfUnmute
void selfUnmute()
Unmutes yourself locally for the server.This cannot be undone by other users. If you want to unmute yourself server-side, so that others can mute you, use
unmuteYourself(),unmuteUser(User)orunmuteUser(User, String).- See Also:
unmuteYourself(),unmuteUser(User),unmuteUser(User, String)
-
muteYourself
default java.util.concurrent.CompletableFuture<java.lang.Void> muteYourself()
Mutes yourself on the server.- Returns:
- A future to check if the mute was successful.
-
unmuteYourself
default java.util.concurrent.CompletableFuture<java.lang.Void> unmuteYourself()
Unmutes yourself on the server.- Returns:
- A future to check if the unmute was successful.
-
muteUser
default java.util.concurrent.CompletableFuture<java.lang.Void> muteUser(User user)
Mutes the given user on the server.- Parameters:
user- The user to mute.- Returns:
- A future to check if the mute was successful.
-
muteUser
default java.util.concurrent.CompletableFuture<java.lang.Void> muteUser(User user, java.lang.String reason)
Mutes the given user on the server.- Parameters:
user- The user to mute.reason- The audit log reason for this action.- Returns:
- A future to check if the mute was successful.
-
unmuteUser
default java.util.concurrent.CompletableFuture<java.lang.Void> unmuteUser(User user)
Unmutes the given user on the server.- Parameters:
user- The user to unmute.- Returns:
- A future to check if the unmute was successful.
-
unmuteUser
default java.util.concurrent.CompletableFuture<java.lang.Void> unmuteUser(User user, java.lang.String reason)
Unmutes the given user on the server.- Parameters:
user- The user to unmute.reason- The audit log reason for this action.- Returns:
- A future to check if the unmute was successful.
-
selfDeafen
void selfDeafen()
Deafens yourself locally for the server.This cannot be undone by other users. If you want to deafen yourself server-side, so that others can undeafen you, use
deafenYourself(),deafenUser(User)ordeafenUser(User, String).- See Also:
deafenYourself(),deafenUser(User),deafenUser(User, String)
-
selfUndeafen
void selfUndeafen()
Undeafens yourself locally for the server.This cannot be undone by other users. If you want to undeafen yourself server-side, so that others can deafen you, use
undeafenYourself(),undeafenUser(User)orundeafenUser(User, String).
-
deafenYourself
default java.util.concurrent.CompletableFuture<java.lang.Void> deafenYourself()
Deafens yourself on the server.- Returns:
- A future to check if the deafen was successful.
-
undeafenYourself
default java.util.concurrent.CompletableFuture<java.lang.Void> undeafenYourself()
Undeafens yourself on the server.- Returns:
- A future to check if the undeafen was successful.
-
deafenUser
default java.util.concurrent.CompletableFuture<java.lang.Void> deafenUser(User user)
Deafens the given user on the server.- Parameters:
user- The user to deafen.- Returns:
- A future to check if the deafen was successful.
-
deafenUser
default java.util.concurrent.CompletableFuture<java.lang.Void> deafenUser(User user, java.lang.String reason)
Deafens the given user on the server.- Parameters:
user- The user to deafen.reason- The audit log reason for this action.- Returns:
- A future to check if the deafen was successful.
-
requestMember
default java.util.concurrent.CompletableFuture<User> requestMember(User user)
Requests a server member.- Parameters:
user- The user to request as a member.- Returns:
- A future to get a server member if it exists in the server.
-
requestMember
java.util.concurrent.CompletableFuture<User> requestMember(long userId)
Requests a server member.- Parameters:
userId- The user id of the member to request.- Returns:
- A future to get a server member if it exists in the server.
-
undeafenUser
default java.util.concurrent.CompletableFuture<java.lang.Void> undeafenUser(User user)
Undeafens the given user on the server.- Parameters:
user- The user to undeafen.- Returns:
- A future to check if the undeafen was successful.
-
undeafenUser
default java.util.concurrent.CompletableFuture<java.lang.Void> undeafenUser(User user, java.lang.String reason)
Undeafens the given user on the server.- Parameters:
user- The user to undeafen.reason- The audit log reason for this action.- Returns:
- A future to check if the undeafen was successful.
-
kickUser
default java.util.concurrent.CompletableFuture<java.lang.Void> kickUser(User user)
Kicks the given user from the server.- Parameters:
user- The user to kick.- Returns:
- A future to check if the kick was successful.
-
kickUser
java.util.concurrent.CompletableFuture<java.lang.Void> kickUser(User user, java.lang.String reason)
Kicks the given user from the server.- Parameters:
user- The user to kick.reason- The audit log reason for this action.- Returns:
- A future to check if the kick was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(User user)
Bans the given user from the server.- Parameters:
user- The user to ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(User user, long deleteMessageDuration, java.util.concurrent.TimeUnit unit)
Bans the given user from the server.- Parameters:
user- The user to ban.deleteMessageDuration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))unit- The unit of time for the duration.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(User user, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)
Bans the given user from the server.- Parameters:
user- The user to ban.deleteMessageDuration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))unit- The unit of time for the duration.reason- The reason for the ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(User user, java.time.Duration duration)
Bans the given user from the server.- Parameters:
user- The user to ban.duration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(User user, java.time.Duration duration, java.lang.String reason)
Bans the given user from the server.- Parameters:
user- The user to ban.duration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))reason- The reason for the ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(java.lang.String userId)
Bans the given user from the server.- Parameters:
userId- The id of the user to ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(long userId)
Bans the given user from the server.- Parameters:
userId- The id of the user to ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(java.lang.String userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.deleteMessageDuration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))unit- The unit of time for the duration.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(long userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.deleteMessageDuration- The number of messages to delete within the duration. Between 0 and 604800 seconds (7 days))unit- The unit of time for the duration.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(java.lang.String userId, java.time.Duration duration)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.duration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(long userId, java.time.Duration duration)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.duration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))- Returns:
- A future to check if the ban was successful.
-
banUser
java.util.concurrent.CompletableFuture<java.lang.Void> banUser(java.lang.String userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.deleteMessageDuration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))unit- The unit of time for the duration.reason- The reason for the ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(long userId, long deleteMessageDuration, java.util.concurrent.TimeUnit unit, java.lang.String reason)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.deleteMessageDuration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))unit- The unit of time for the duration.reason- The reason for the ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(java.lang.String userId, java.time.Duration duration, java.lang.String reason)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.duration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))reason- The reason for the ban.- Returns:
- A future to check if the ban was successful.
-
banUser
default java.util.concurrent.CompletableFuture<java.lang.Void> banUser(long userId, java.time.Duration duration, java.lang.String reason)Bans the given user from the server.- Parameters:
userId- The id of the user to ban.duration- The number of messages to delete within the duration. (Between 0 and 604800 seconds (7 days))reason- The reason for the ban.- Returns:
- A future to check if the ban was successful.
-
unbanUser
default java.util.concurrent.CompletableFuture<java.lang.Void> unbanUser(User user)
Unbans the given user from the server.- Parameters:
user- The user to ban.- Returns:
- A future to check if the unban was successful.
-
unbanUser
default java.util.concurrent.CompletableFuture<java.lang.Void> unbanUser(long userId)
Unbans the given user from the server.- Parameters:
userId- The id of the user to unban.- Returns:
- A future to check if the unban was successful.
-
unbanUser
default java.util.concurrent.CompletableFuture<java.lang.Void> unbanUser(java.lang.String userId)
Unbans the given user from the server.- Parameters:
userId- The id of the user to unban.- Returns:
- A future to check if the unban was successful.
-
unbanUser
default java.util.concurrent.CompletableFuture<java.lang.Void> unbanUser(User user, java.lang.String reason)
Unbans the given user from the server.- Parameters:
user- The user to ban.reason- The audit log reason for this action.- Returns:
- A future to check if the unban was successful.
-
unbanUser
java.util.concurrent.CompletableFuture<java.lang.Void> unbanUser(long userId, java.lang.String reason)Unbans the given user from the server.- Parameters:
userId- The id of the user to unban.reason- The audit log reason for this action.- Returns:
- A future to check if the unban was successful.
-
unbanUser
default java.util.concurrent.CompletableFuture<java.lang.Void> unbanUser(java.lang.String userId, java.lang.String reason)Unbans the given user from the server.- Parameters:
userId- The id of the user to unban.reason- The audit log reason for this action.- Returns:
- A future to check if the unban was successful.
-
requestBan
default java.util.concurrent.CompletableFuture<Ban> requestBan(User user)
Requests a ban object for the specified user.- Parameters:
user- The user to request the ban object for.- Returns:
- A future to get a server ban object if the user is currently banned.
-
requestBan
java.util.concurrent.CompletableFuture<Ban> requestBan(long userId)
Requests a ban object for the specified user.- Parameters:
userId- The user id to request the ban object for.- Returns:
- A future to get a server ban object if the user is currently banned.
-
getBans
java.util.concurrent.CompletableFuture<java.util.Set<Ban>> getBans()
Gets all server bans. Note: This method firesceil((number of bans + 1) / 1000)requests to Discord as the API returns the results in pages and Javacord collects all pages into one collection. If you want to control pagination yourself, usegetBans(Integer, Long).- Returns:
- All server bans.
-
getBans
java.util.concurrent.CompletableFuture<java.util.Set<Ban>> getBans(java.lang.Integer limit, java.lang.Long after)
Gets up tolimitserver bans, only taking users with an ID higher thanafterinto account. This can be used to get a specific page of bans. To get all pages / all bans at once, usegetBans().- Parameters:
limit- How many bans should be returned at most. Must be within [0, 1000]. If null, it will default to 1000after- Should be a snowflake to only take bans of users with IDs higher than this parameter into account; can be null- Returns:
- Server bans on the given page with at most
limitentries.
-
getWebhooks
java.util.concurrent.CompletableFuture<java.util.List<Webhook>> getWebhooks()
Gets all webhooks in this server.- Returns:
- All webhooks in this server.
-
getAllIncomingWebhooks
java.util.concurrent.CompletableFuture<java.util.List<Webhook>> getAllIncomingWebhooks()
Gets all incoming webhooks in this server, they are not guaranteed to have an accessible token.- Returns:
- All incoming webhooks in this server.
-
getIncomingWebhooks
java.util.concurrent.CompletableFuture<java.util.List<IncomingWebhook>> getIncomingWebhooks()
Gets all incoming webhooks in this server. This method only returns webhooks with a token, that the bot can access.- Returns:
- All incoming webhooks in this server.
-
getAuditLog
java.util.concurrent.CompletableFuture<AuditLog> getAuditLog(int limit)
Gets the audit log of this server.- Parameters:
limit- The maximum amount of audit log entries.- Returns:
- The audit log.
-
getAuditLog
java.util.concurrent.CompletableFuture<AuditLog> getAuditLog(int limit, AuditLogActionType type)
Gets the audit log of this server.- Parameters:
limit- The maximum amount of audit log entries.type- The action type of the audit log.- Returns:
- The audit log.
-
getAuditLogBefore
java.util.concurrent.CompletableFuture<AuditLog> getAuditLogBefore(int limit, AuditLogEntry before)
Gets the audit log of this server.- Parameters:
limit- The maximum amount of audit log entries.before- Filter the log before this entry.- Returns:
- The audit log.
-
getAuditLogBefore
java.util.concurrent.CompletableFuture<AuditLog> getAuditLogBefore(int limit, AuditLogEntry before, AuditLogActionType type)
Gets the audit log of this server.- Parameters:
limit- The maximum amount of audit log entries.before- Filter the log before this entry.type- The action type of the audit log.- Returns:
- The audit log.
-
hasPermission
default boolean hasPermission(User user, PermissionType permission)
Checks if a user has a given permission. Remember, that some permissions affect others! E.g. a user who hasPermissionType.SEND_MESSAGESbut notPermissionType.VIEW_CHANNELcannot send messages, even though he has thePermissionType.SEND_MESSAGESpermission. This method also do not take into account overwritten permissions in some channels!- Parameters:
user- The user.permission- The permission to check.- Returns:
- Whether the user has the permission or not.
-
getCustomEmojis
java.util.Set<KnownCustomEmoji> getCustomEmojis()
Gets all custom emojis of this server.- Returns:
- All custom emojis of this server.
-
getCustomEmojiById
default java.util.Optional<KnownCustomEmoji> getCustomEmojiById(long id)
Gets a custom emoji in this server by its id.- Parameters:
id- The id of the emoji.- Returns:
- The emoji with the given id.
-
getCustomEmojiById
default java.util.Optional<KnownCustomEmoji> getCustomEmojiById(java.lang.String id)
Gets a custom emoji in this server by its id.- Parameters:
id- The id of the emoji.- Returns:
- The emoji with the given id.
-
getCustomEmojisByName
default java.util.Set<KnownCustomEmoji> getCustomEmojisByName(java.lang.String name)
Gets all custom emojis with the given name in the server. This method is case-sensitive!- Parameters:
name- The name of the custom emojis.- Returns:
- All custom emojis with the given name in this server.
-
getCustomEmojisByNameIgnoreCase
default java.util.Set<KnownCustomEmoji> getCustomEmojisByNameIgnoreCase(java.lang.String name)
Gets all custom emojis with the given name in the server. This method is case-insensitive!- Parameters:
name- The name of the custom emojis.- Returns:
- All custom emojis with the given name in this server.
-
getSlashCommands
java.util.concurrent.CompletableFuture<java.util.Set<SlashCommand>> getSlashCommands()
Gets all slash commands for the given server.- Returns:
- All slash commands from the server.
-
getSlashCommandById
java.util.concurrent.CompletableFuture<SlashCommand> getSlashCommandById(long commandId)
Gets a server slash command by its id.- Parameters:
commandId- The id of the server slash command.- Returns:
- The server slash command with the given id.
-
createChannelCategoryBuilder
default ChannelCategoryBuilder createChannelCategoryBuilder()
Creates a new channel category builder.- Returns:
- A builder to create a new channel category.
-
createTextChannelBuilder
default ServerTextChannelBuilder createTextChannelBuilder()
Creates a new server text channel builder.- Returns:
- A builder to create a new server text channel.
-
createVoiceChannelBuilder
default ServerVoiceChannelBuilder createVoiceChannelBuilder()
Creates a new server voice channel builder.- Returns:
- A builder to create a new server voice channel.
-
createRoleBuilder
default RoleBuilder createRoleBuilder()
Creates a new role builder.- Returns:
- A builder to create a new role.
-
getChannels
java.util.List<ServerChannel> getChannels()
Gets a sorted list (by position) with all channels of the server.- Returns:
- A sorted list (by position) with all channels of the server.
-
getUnorderedChannels
java.util.Set<ServerChannel> getUnorderedChannels()
Gets an unordered collection with all channels in the server.- Returns:
- An unordered collection with all channels in the server.
-
getRegularChannels
java.util.List<RegularServerChannel> getRegularChannels()
Gets a sorted list (by position) with all regular channels of the server.- Returns:
- A sorted list (by position) with all regular channels of the server.
-
getChannelCategories
java.util.List<ChannelCategory> getChannelCategories()
Gets a sorted list (by position) with all channel categories of the server.- Returns:
- A sorted list (by position) with all channel categories of the server.
-
getTextChannels
java.util.List<ServerTextChannel> getTextChannels()
Gets a sorted list (by position) with all text channels of the server.- Returns:
- A sorted list (by position) with all text channels of the server.
-
getForumChannels
java.util.List<ServerForumChannel> getForumChannels()
Gets a sorted list (by position) with all forum channels of the server.- Returns:
- A sorted list (by position) with all forum channels of the server.
-
getVoiceChannels
java.util.List<ServerVoiceChannel> getVoiceChannels()
Gets a sorted list (by position) with all voice channels of the server.- Returns:
- A sorted list (by position) with all voice channels of the server.
-
getThreadChannels
java.util.List<ServerThreadChannel> getThreadChannels()
Gets a sorted list (by archive timestamp from old to new) with all thread channels of the server.- Returns:
- A sorted list (by archive timestamp from old to new) with all thread channels of the server.
-
getChannelById
java.util.Optional<ServerChannel> getChannelById(long id)
Gets a channel by its id.- Parameters:
id- The id of the channel.- Returns:
- The channel with the given id.
-
getChannelById
default java.util.Optional<ServerChannel> getChannelById(java.lang.String id)
Gets a channel by its id.- Parameters:
id- The id of the channel.- Returns:
- The channel with the given id.
-
getChannelsByName
default java.util.List<ServerChannel> getChannelsByName(java.lang.String name)
Gets a sorted list (by position) with all channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the channels.- Returns:
- A sorted list (by position) with all channels with the given name.
-
getChannelsByNameIgnoreCase
default java.util.List<ServerChannel> getChannelsByNameIgnoreCase(java.lang.String name)
Gets a sorted list (by position) with all channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the channels.- Returns:
- A sorted list (by position) with all channels with the given name.
-
getRegularChannelById
java.util.Optional<RegularServerChannel> getRegularChannelById(long id)
Gets a regular channel by its id.- Parameters:
id- The id of the regular channel.- Returns:
- The regular channel with the given id.
-
getRegularChannelById
default java.util.Optional<RegularServerChannel> getRegularChannelById(java.lang.String id)
Gets a regular channel by its id.- Parameters:
id- The id of the regular channel.- Returns:
- The regular channel with the given id.
-
getRegularChannelsByName
default java.util.List<RegularServerChannel> getRegularChannelsByName(java.lang.String name)
Gets a sorted list (by position) with all channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the channels.- Returns:
- A sorted list (by position) with all channels with the given name.
-
getRegularChannelsByNameIgnoreCase
default java.util.List<RegularServerChannel> getRegularChannelsByNameIgnoreCase(java.lang.String name)
Gets a sorted list (by position) with all channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the channels.- Returns:
- A sorted list (by position) with all channels with the given name.
-
getChannelCategoryById
default java.util.Optional<ChannelCategory> getChannelCategoryById(long id)
Gets a channel category by its id.- Parameters:
id- The id of the channel category.- Returns:
- The channel category with the given id.
-
getChannelCategoryById
default java.util.Optional<ChannelCategory> getChannelCategoryById(java.lang.String id)
Gets a channel category by its id.- Parameters:
id- The id of the channel category.- Returns:
- The channel category with the given id.
-
getChannelCategoriesByName
default java.util.List<ChannelCategory> getChannelCategoriesByName(java.lang.String name)
Gets a sorted list (by position) with all channel categories with the given name. This method is case-sensitive!- Parameters:
name- The name of the channel categories.- Returns:
- A sorted list (by position) with all channel categories with the given name.
-
getChannelCategoriesByNameIgnoreCase
default java.util.List<ChannelCategory> getChannelCategoriesByNameIgnoreCase(java.lang.String name)
Gets a sorted list (by position) with all channel categories with the given name. This method is case-insensitive!- Parameters:
name- The name of the channel categories.- Returns:
- A sorted list (by position) with all channel categories with the given name.
-
getUnknownChannelById
default java.util.Optional<UnknownServerChannel> getUnknownChannelById(long id)
Gets an unknown channel by its id.- Parameters:
id- The id of the unknown channel.- Returns:
- The unknown channel with the given id.
-
getUnknownChannelById
default java.util.Optional<UnknownServerChannel> getUnknownChannelById(java.lang.String id)
Gets an unknown channel by its id.- Parameters:
id- The id of the unknown channel.- Returns:
- The unknown channel with the given id.
-
getUnknownRegularChannelById
default java.util.Optional<UnknownRegularServerChannel> getUnknownRegularChannelById(long id)
Gets an unknown regular channel by its id.- Parameters:
id- The id of the unknown regular channel.- Returns:
- The unknown regular channel with the given id.
-
getUnknownRegularChannelById
default java.util.Optional<UnknownRegularServerChannel> getUnknownRegularChannelById(java.lang.String id)
Gets an unknown regular channel by its id.- Parameters:
id- The id of the unknown regular channel.- Returns:
- The unknown regular channel with the given id.
-
getTextChannelById
default java.util.Optional<ServerTextChannel> getTextChannelById(long id)
Gets a text channel by its id.- Parameters:
id- The id of the text channel.- Returns:
- The text channel with the given id.
-
getTextChannelById
default java.util.Optional<ServerTextChannel> getTextChannelById(java.lang.String id)
Gets a text channel by its id.- Parameters:
id- The id of the text channel.- Returns:
- The text channel with the given id.
-
getForumChannelById
default java.util.Optional<ServerForumChannel> getForumChannelById(long id)
Gets a forum channel by its id.- Parameters:
id- The id of the forum channel.- Returns:
- The forum channel with the given id.
-
getForumChannelById
default java.util.Optional<ServerForumChannel> getForumChannelById(java.lang.String id)
Gets a forum channel by its id.- Parameters:
id- The id of the forum channel.- Returns:
- The forum channel with the given id.
-
getThreadChannelById
default java.util.Optional<ServerThreadChannel> getThreadChannelById(long id)
Gets a channel thread by its id.- Parameters:
id- The id of the threat.- Returns:
- The threat with the given id.
-
getThreadChannelById
default java.util.Optional<ServerThreadChannel> getThreadChannelById(java.lang.String id)
Gets a channel thread by its id.- Parameters:
id- The id of the thread.- Returns:
- The thread with the given id.
-
getTextChannelsByName
default java.util.List<ServerTextChannel> getTextChannelsByName(java.lang.String name)
Gets a sorted list (by position) with all text channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the text channels.- Returns:
- A sorted list (by position) with all text channels with the given name.
-
getTextChannelsByNameIgnoreCase
default java.util.List<ServerTextChannel> getTextChannelsByNameIgnoreCase(java.lang.String name)
Gets a sorted list (by position) with all text channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the text channels.- Returns:
- A sorted list (by position) with all text channels with the given name.
-
getForumChannelsByName
default java.util.List<ServerForumChannel> getForumChannelsByName(java.lang.String name)
Gets a sorted list (by position) with all text channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the text channels.- Returns:
- A sorted list (by position) with all text channels with the given name.
-
getForumChannelsByNameIgnoreCase
default java.util.List<ServerForumChannel> getForumChannelsByNameIgnoreCase(java.lang.String name)
Gets a sorted list (by position) with all forum channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the text channels.- Returns:
- A sorted list (by position) with all text channels with the given name.
-
getVoiceChannelById
default java.util.Optional<ServerVoiceChannel> getVoiceChannelById(long id)
Gets a voice channel by its id.- Parameters:
id- The id of the voice channel.- Returns:
- The voice channel with the given id.
-
getVoiceChannelById
default java.util.Optional<ServerVoiceChannel> getVoiceChannelById(java.lang.String id)
Gets a voice channel by its id.- Parameters:
id- The id of the voice channel.- Returns:
- The voice channel with the given id.
-
getStageVoiceChannelById
default java.util.Optional<ServerStageVoiceChannel> getStageVoiceChannelById(long id)
Gets a stage voice channel by its id.- Parameters:
id- The id of the stage voice channel.- Returns:
- The stage voice channel with the given id.
-
getStageVoiceChannelById
default java.util.Optional<ServerStageVoiceChannel> getStageVoiceChannelById(java.lang.String id)
Gets a voice channel by its id.- Parameters:
id- The id of the voice channel.- Returns:
- The voice channel with the given id.
-
getVoiceChannelsByName
default java.util.List<ServerVoiceChannel> getVoiceChannelsByName(java.lang.String name)
Gets a sorted list (by position) with all voice channels with the given name. This method is case-sensitive!- Parameters:
name- The name of the voice channels.- Returns:
- A sorted list (by position) with all voice channels with the given name.
-
getVoiceChannelsByNameIgnoreCase
default java.util.List<ServerVoiceChannel> getVoiceChannelsByNameIgnoreCase(java.lang.String name)
Gets a sorted list (by position) with all voice channels with the given name. This method is case-insensitive!- Parameters:
name- The name of the voice channels.- Returns:
- A sorted list (by position) with all voice channels with the given name.
-
getConnectedVoiceChannel
default java.util.Optional<ServerVoiceChannel> getConnectedVoiceChannel(long userId)
Gets the voice channel the user with the given id is connected to on this server if any.- Parameters:
userId- The id of the user to check.- Returns:
- The voice channel the user is connected to.
-
getConnectedVoiceChannel
default java.util.Optional<ServerVoiceChannel> getConnectedVoiceChannel(User user)
Gets the voice channel the given user is connected to on this server if any.- Parameters:
user- The user to check.- Returns:
- The voice channel the user is connected to.
-
getVisibleChannels
default java.util.List<ServerChannel> getVisibleChannels(User user)
Gets a sorted (by position) list with all channels of this server the given user can see. Returns an empty list, if the user is not a member of this server.- Parameters:
user- The user to check.- Returns:
- The visible channels of this server.
-
getHighestRole
default java.util.Optional<Role> getHighestRole(User user)
Gets the highest role of the given user in this server. The optional is empty, if the user is not a member of this server.- Parameters:
user- The user.- Returns:
- The highest role of the given user.
-
isOwner
default boolean isOwner(User user)
Checks if the given user is the owner of the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user is the owner of the server or not.
-
isAdmin
default boolean isAdmin(User user)
Checks if the given user is an administrator of the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user is an administrator of the server or not.
-
canCreateChannels
default boolean canCreateChannels(User user)
Checks if the given user can create new channels.- Parameters:
user- The user to check.- Returns:
- Whether the given user can create channels or not.
-
canYouCreateChannels
default boolean canYouCreateChannels()
Checks if the user of the connected account can create new channels.- Returns:
- Whether the user of the connected account can create channels or not.
-
canViewAuditLog
default boolean canViewAuditLog(User user)
Checks if the given user can view the audit log of the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can view the audit log or not.
-
canYouViewAuditLog
default boolean canYouViewAuditLog()
Checks if the user of the connected account can view the audit log of the server.- Returns:
- Whether the user of the connected account can view the audit log or not.
-
canChangeOwnNickname
default boolean canChangeOwnNickname(User user)
Checks if the given user can change its own nickname in the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can change its own nickname or not.
-
canYouChangeOwnNickname
default boolean canYouChangeOwnNickname()
Checks if the user of the connected account can change its own nickname in the server.- Returns:
- Whether the user of the connected account can change its own nickname or not.
-
canManageNicknames
default boolean canManageNicknames(User user)
Checks if the given user can manage nicknames on the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can manage nicknames or not.
-
canYouManageNicknames
default boolean canYouManageNicknames()
Checks if the user of the connected account can manage nicknames on the server.- Returns:
- Whether the user of the connected account can manage nicknames or not.
-
canMuteMembers
default boolean canMuteMembers(User user)
Checks if the given user can mute members on the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can mute members or not.
-
canYouMuteMembers
default boolean canYouMuteMembers()
Checks if the user of the connected account can mute members on the server.- Returns:
- Whether the user of the connected account can mute members or not.
-
canDeafenMembers
default boolean canDeafenMembers(User user)
Checks if the given user can deafen members on the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can deafen members or not.
-
canYouDeafenMembers
default boolean canYouDeafenMembers()
Checks if the user of the connected account can deafen members on the server.- Returns:
- Whether the user of the connected account can deafen members or not.
-
canMoveMembers
default boolean canMoveMembers(User user)
Checks if the given user can move members on the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can move members or not.
-
canYouMoveMembers
default boolean canYouMoveMembers()
Checks if the user of the connected account can move members on the server.- Returns:
- Whether the user of the connected account can move members or not.
-
canManageEmojis
default boolean canManageEmojis(User user)
Checks if the given user can manage emojis on the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can manage emojis or not.
-
canYouManageEmojis
default boolean canYouManageEmojis()
Checks if the user of the connected account can manage emojis on the server.- Returns:
- Whether the user of the connected account can manage emojis or not.
-
canUseSlashCommands
default boolean canUseSlashCommands(User user)
Checks if the given user can use slash commands on the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can use slash commands or not.
-
canYouUseSlashCommands
default boolean canYouUseSlashCommands()
Checks if the user of the connected account can use slash commands on the server.- Returns:
- Whether the user of the connected account can use slash commands or not.
-
canManageRoles
default boolean canManageRoles(User user)
Checks if the given user can manage roles on the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can manage roles or not.
-
canYouManageRoles
default boolean canYouManageRoles()
Checks if the user of the connected account can manage roles on the server.- Returns:
- Whether the user of the connected account can manage roles or not.
-
canManageRolesOf
default boolean canManageRolesOf(User user, User target)
Checks if the user can manage the roles of the target user.- Parameters:
user- The user that tries to manage roles.target- The user whose roles are to be managed.- Returns:
- Whether the user can manage the target's roles.
-
canManageRole
default boolean canManageRole(User user, Role target)
Checks if the user can manage the target role.- Parameters:
user- The user that tries to manage the role.target- The role that is to be managed.- Returns:
- Whether the user can manage the role.
-
canManage
default boolean canManage(User user)
Checks if the given user can manage the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can manage the server or not.
-
canYouManage
default boolean canYouManage()
Checks if the user of the connected account can manage the server.- Returns:
- Whether the user of the connected account can manage the server or not.
-
canKickUsers
default boolean canKickUsers(User user)
Checks if the given user can kick users from the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can kick users or not.
-
canYouKickUsers
default boolean canYouKickUsers()
Checks if the user of the connected account can kick users from the server.- Returns:
- Whether the user of the connected account can kick users or not.
-
canKickUser
default boolean canKickUser(User user, User userToKick)
Checks if the given user can kick the other user. This method also considers the position of the user roles and the owner. If the to-be-kicked user is not part of this server, stilltrueis returned as Discord allows this.- Parameters:
user- The user which "want" to kick the other user.userToKick- The user which should be kicked.- Returns:
- Whether the given user can kick the other user or not.
-
canYouKickUser
default boolean canYouKickUser(User userToKick)
Checks if the user of the connected account can kick the user. This method also considers the position of the user roles and the owner.- Parameters:
userToKick- The user which should be kicked.- Returns:
- Whether the user of the connected account can kick the user or not.
-
canBanUsers
default boolean canBanUsers(User user)
Checks if the given user can ban users from the server.- Parameters:
user- The user to check.- Returns:
- Whether the given user can ban users or not.
-
canYouBanUsers
default boolean canYouBanUsers()
Checks if the user of the connected account can ban users from the server.- Returns:
- Whether the user of the connected account can ban users or not.
-
canBanUser
default boolean canBanUser(User user, User userToBan)
Checks if the given user can ban the other user. This method also considers the position of the user roles and the owner.- Parameters:
user- The user which "want" to ban the other user.userToBan- The user which should be banned.- Returns:
- Whether the given user can ban the other user or not.
-
canYouBanUser
default boolean canYouBanUser(User userToBan)
Checks if the user of the connected account can ban the user. This method also considers the position of the user roles and the owner.- Parameters:
userToBan- The user which should be banned.- Returns:
- Whether the user of the connected account can ban the user or not.
-
getCurrentCachedInstance
default java.util.Optional<Server> 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 interfaceUpdatableFromCache<Server>- Returns:
- The current cached instance.
-
joinServerThreadChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> joinServerThreadChannel(ServerThreadChannel serverThreadChannel)
Joins this ServerThreadChannel. Also requires the thread is not archived.- Parameters:
serverThreadChannel- The ServerThreadChannel which should be joined.- Returns:
- A future to check if the update was successful.
-
joinServerThreadChannel
java.util.concurrent.CompletableFuture<java.lang.Void> joinServerThreadChannel(long channelId)
Joins this ServerThreadChannel. Also requires the thread is not archived.- Parameters:
channelId- The ServerThreadChannel ID which should be joined.- Returns:
- A future to check if the update was successful.
-
leaveServerThreadChannel
default java.util.concurrent.CompletableFuture<java.lang.Void> leaveServerThreadChannel(ServerThreadChannel serverThreadChannel)
Leaves this ServerThreadChannel.- Parameters:
serverThreadChannel- The ServerThreadChannel which should be left.- Returns:
- A future to check if the update was successful.
-
leaveServerThreadChannel
java.util.concurrent.CompletableFuture<java.lang.Void> leaveServerThreadChannel(long channelId)
Leaves this ServerThreadChannel.- Parameters:
channelId- The ServerThreadChannel ID which should be left.- Returns:
- A future to check if the update was successful.
-
getActiveThreads
java.util.concurrent.CompletableFuture<ActiveThreads> getActiveThreads()
Gets the active threads in this Server.- Returns:
- The active threads.
-
getStickers
java.util.Set<Sticker> getStickers()
Gets the stickers of this server.- Returns:
- The stickers of this server.
-
requestStickers
java.util.concurrent.CompletableFuture<java.util.Set<Sticker>> requestStickers()
Requests the sticker of this server from the Discord API without checking the cache.- Returns:
- The stickers of this server.
-
getStickerById
default java.util.Optional<Sticker> getStickerById(long id)
Gets a sticker by its ID.- Parameters:
id- The ID of the sticker.- Returns:
- The sticker with the given ID.
-
getStickerById
default java.util.Optional<Sticker> getStickerById(java.lang.String id)
Gets a sticker by its ID.- Parameters:
id- The ID of the sticker.- Returns:
- The sticker with the given ID.
-
getStickersByName
default java.util.Set<Sticker> getStickersByName(java.lang.String name)
Gets stickers by their name. The name is case-sensitive!- Parameters:
name- The name of the stickers.- Returns:
- Stickers with the given name.
-
getStickersByNameIgnoreCase
default java.util.Set<Sticker> getStickersByNameIgnoreCase(java.lang.String name)
Gets stickers by their name. The name is case-insensitive!- Parameters:
name- The name of the stickers.- Returns:
- Stickers with the given name.
-
requestStickerById
java.util.concurrent.CompletableFuture<Sticker> requestStickerById(long id)
Requests a sticker by its ID from the Discord API without checking the cache.- Parameters:
id- The ID of the sticker.- Returns:
- The sticker with the given ID.
-
requestStickerById
default java.util.concurrent.CompletableFuture<Sticker> requestStickerById(java.lang.String id)
Requests a sticker by its ID from the Discord API without checking the cache.- Parameters:
id- The ID of the sticker.- Returns:
- The sticker with the given ID.
-
isWidgetEnabled
boolean isWidgetEnabled()
True if the server widget is enabled.- Returns:
- true if the server widget is enabled.
-
getWidgetChannelId
java.util.Optional<java.lang.Long> getWidgetChannelId()
Gets the channel id that the widget will generate an invite to, or null if set to no invite.- Returns:
- the channel id that the widget will generate an invite to, or null if set to no invite.
-
getMaxPresences
java.util.Optional<java.lang.Integer> getMaxPresences()
Gets the maximum number of presences for the guild (null is always returned, apart from the largest of guilds).- Returns:
- the maximum number of presences for the guild.
-
getMaxMembers
java.util.Optional<java.lang.Integer> getMaxMembers()
Gets the maximum number of members for the guild.- Returns:
- the maximum number of members for the guild.
-
getMaxVideoChannelUsers
java.util.Optional<java.lang.Integer> getMaxVideoChannelUsers()
Gets the maximum amount of users in a video channel.- Returns:
- the maximum amount of users in a video channel.
-
getWelcomeScreen
java.util.Optional<WelcomeScreen> getWelcomeScreen()
Gets the welcome screen of a Community server shown to new members.- Returns:
- the welcome screen of a Community server shown to new members.
-
isPremiumProgressBarEnabled
boolean isPremiumProgressBarEnabled()
True if the server's boost progress bar is enabled.- Returns:
- whether the server's boost progress bar is enabled or not.
-
getWidgetChannel
default java.util.Optional<RegularServerChannel> getWidgetChannel()
Gets regular server channel for widget.- Returns:
- the regular server channel for widget.
-
getSystemChannelFlags
java.util.EnumSet<SystemChannelFlag> getSystemChannelFlags()
Gets system channel flags for this server.- Returns:
- The system channel flags for this server.
-
-