public final class Guild extends Object implements Entity
Modifier and Type | Class and Description |
---|---|
static class |
Guild.ContentFilterLevel
Automatically scan and delete messages sent in the server that contain explicit content.
|
static class |
Guild.MfaLevel
Prevent potentially dangerous administrative actions for users without two-factor authentication enabled.
|
static class |
Guild.NotificationLevel
Determines whether
Members who have not explicitly set their notification settings receive a
notification for every message sent in the server or not. |
static class |
Guild.PremiumTier
Represent the server Premium Tier (aka boost level) of the
Guild . |
static class |
Guild.SystemChannelFlag
Describes system channel flags.
|
static class |
Guild.VerificationLevel
Members of the server must meet the following criteria before they can send messages in text
channels or initiate a direct message conversation. |
Constructor and Description |
---|
Guild(GatewayDiscordClient gateway,
discord4j.discordjson.json.GuildData data)
Constructs an
Guild with an associated ServiceMediator and Discord data. |
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
ban(Snowflake userId,
Consumer<? super BanQuerySpec> spec)
Requests to ban the specified user.
|
Mono<String> |
changeSelfNickname(String nickname)
Requests to change the bot user's nickname in this guild.
|
Mono<Category> |
createCategory(Consumer<? super CategoryCreateSpec> spec)
Requests to create a category.
|
Mono<GuildEmoji> |
createEmoji(Consumer<? super GuildEmojiCreateSpec> spec)
Requests to create an emoji.
|
Mono<NewsChannel> |
createNewsChannel(Consumer<? super NewsChannelCreateSpec> spec)
Requests to create a news channel.
|
Mono<Role> |
createRole(Consumer<? super RoleCreateSpec> spec)
Requests to create a role.
|
Mono<TextChannel> |
createTextChannel(Consumer<? super TextChannelCreateSpec> spec)
Requests to create a text channel.
|
Mono<VoiceChannel> |
createVoiceChannel(Consumer<? super VoiceChannelCreateSpec> spec)
Requests to create a voice channel.
|
Mono<Void> |
delete()
Requests to delete this guild.
|
Mono<Guild> |
edit(Consumer<? super GuildEditSpec> spec)
Requests to edit this guild.
|
boolean |
equals(Object obj) |
Mono<VoiceChannel> |
getAfkChannel()
Requests to retrieve the AFK channel, if present.
|
Mono<VoiceChannel> |
getAfkChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the AFK channel, if present, using the given retrieval strategy.
|
Optional<Snowflake> |
getAfkChannelId()
Gets the ID of the AFK channel, if present.
|
int |
getAfkTimeout()
Gets the AFK timeout in seconds.
|
Optional<Snowflake> |
getApplicationId()
Gets the application ID of the guild creator if it is bot-created.
|
Flux<AuditLogEntry> |
getAuditLog()
Requests to retrieve the audit log for this guild.
|
Flux<AuditLogEntry> |
getAuditLog(Consumer<? super AuditLogQuerySpec> spec)
Requests to retrieve the audit log for this guild.
|
Mono<Ban> |
getBan(Snowflake userId)
Requests to retrieve the ban for the specified user for this guild.
|
Mono<Image> |
getBanner(Image.Format format)
Gets the banner of the guild.
|
Optional<String> |
getBannerUrl(Image.Format format)
Gets the banner URL of the guild, if present.
|
Flux<Ban> |
getBans()
Requests to retrieve all the bans for this guild.
|
Mono<GuildChannel> |
getChannelById(Snowflake id)
Requests to retrieve the channel as represented by the supplied ID.
|
Mono<GuildChannel> |
getChannelById(Snowflake id,
EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the channel as represented by the supplied ID, using the given retrieval strategy.
|
Flux<GuildChannel> |
getChannels()
Requests to retrieve the guild's channels.
|
Flux<GuildChannel> |
getChannels(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild's channels, using the given retrieval strategy.
|
GatewayDiscordClient |
getClient()
Returns the
GatewayDiscordClient that created this object. |
Guild.ContentFilterLevel |
getContentFilterLevel()
Gets the default explicit content filter level.
|
Optional<String> |
getDescription()
Gets the description of the guild, if present.
|
Mono<Image> |
getDiscoverySplash(Image.Format format)
Gets the discovery splash of the guild.
|
Optional<String> |
getDiscoverySplashUrl(Image.Format format)
Gets the discovery splash URL of the guild, if present.
|
Mono<GuildChannel> |
getEmbedChannel()
Requests to retrieve the embedded channel, if present.
|
Mono<GuildChannel> |
getEmbedChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the embedded channel, if present, using the given retrieval strategy.
|
Optional<Snowflake> |
getEmbedChannelId()
Deprecated.
Use
Guild#getWidgetChannelId instead. For removal in v3.2 |
Set<Snowflake> |
getEmojiIds()
Gets the guild's emoji's IDs.
|
Flux<GuildEmoji> |
getEmojis()
Requests to retrieve the guild's emojis.
|
Flux<GuildEmoji> |
getEmojis(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild's emojis, using the given retrieval strategy.
|
Mono<Role> |
getEveryoneRole()
Requests to retrieve the guild's @everyone
Role . |
Mono<Role> |
getEveryoneRole(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild's @everyone
Role , using the given retrieval strategy. |
Set<String> |
getFeatures()
Gets the enabled guild features.
|
Mono<GuildEmoji> |
getGuildEmojiById(Snowflake id)
Requests to retrieve the guild emoji as represented by the supplied ID.
|
Mono<GuildEmoji> |
getGuildEmojiById(Snowflake id,
EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild emoji as represented by the supplied ID, using the given retrieval strategy.
|
Mono<Image> |
getIcon(Image.Format format)
Gets the icon of the guild.
|
Optional<String> |
getIconUrl(Image.Format format)
Gets the icon URL of the guild, if present.
|
Snowflake |
getId()
Gets the Snowflake that uniquely identifies this entity.
|
Flux<ExtendedInvite> |
getInvites()
Requests to retrieve the invites of the guild.
|
Instant |
getJoinTime()
Gets when this guild was joined at.
|
OptionalInt |
getMaxMembers()
Gets the maximum amount of members of the guild, if present.
|
int |
getMaxPresences()
Gets the maximum amount of presences of the guild.
|
Optional<Integer> |
getMaxVideoChannelUsers()
Gets the maximum amount of users in a video channel, if present.
|
Mono<Member> |
getMemberById(Snowflake id)
Requests to retrieve the member as represented by the supplied ID.
|
Mono<Member> |
getMemberById(Snowflake id,
EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the member as represented by the supplied ID, using the given retrieval strategy.
|
int |
getMemberCount()
Gets the total number of members in the guild.
|
Flux<Member> |
getMembers()
Requests to retrieve the members of the guild.
|
Flux<Member> |
getMembers(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the members of the guild, using the given retrieval strategy.
|
Guild.MfaLevel |
getMfaLevel()
Gets the required MFA level for the guild.
|
String |
getName()
Gets the guild name.
|
Guild.NotificationLevel |
getNotificationLevel()
Gets the default message notification level..
|
Mono<Member> |
getOwner()
Requests to retrieve the owner of the guild.
|
Snowflake |
getOwnerId()
Gets the ID of the owner of the guild.
|
Locale |
getPreferredLocale()
Gets the preferred locale of a "PUBLIC" guild used in server discovery and notices from Discord; defaults to
"en-US".
|
OptionalInt |
getPremiumSubscriptionCount()
Gets the number of boosts this server currently has, if present.
|
Guild.PremiumTier |
getPremiumTier()
Gets the Premium Tier (Server Boost level) for the guild.
|
Flux<Presence> |
getPresences()
Requests to retrieve the presences of the guild.
|
Mono<Integer> |
getPruneCount(Consumer<? super GuildPruneCountSpec> spec)
Requests to retrieve the number of users that will be pruned.
|
Mono<Integer> |
getPruneCount(int days)
Requests to retrieve the number of users that will be pruned.
|
Mono<TextChannel> |
getPublicUpdatesChannel()
Requests to retrieve the channel where admins and moderators of "PUBLIC" guilds receive notices from Discord,
if present.
|
Mono<TextChannel> |
getPublicUpdatesChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the channel where admins and moderators of "PUBLIC" guilds receive notices from Discord,
if present,
using the given retrieval strategy.
|
Optional<Snowflake> |
getPublicUpdatesChannelId()
Gets the id of the channel where admins and moderators of "PUBLIC" guilds receive notices from Discord, if
present.
|
Mono<Region> |
getRegion()
Requests to retrieve the voice region for the guild.
|
String |
getRegionId()
Gets the voice region ID for the guild.
|
Flux<Region> |
getRegions()
Requests to retrieve the voice regions for the guild.
|
Mono<Role> |
getRoleById(Snowflake id)
Requests to retrieve the role as represented by the supplied ID.
|
Mono<Role> |
getRoleById(Snowflake id,
EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the role as represented by the supplied ID, using the given retrieval strategy.
|
Set<Snowflake> |
getRoleIds()
Gets the guild's roles' IDs.
|
Flux<Role> |
getRoles()
Requests to retrieve the guild's roles.
|
Flux<Role> |
getRoles(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild's roles, using the given retrieval strategy.
|
Mono<TextChannel> |
getRulesChannel()
Requests to retrieve the channel where "PUBLIC" guilds display rules and/or guidelines, if present.
|
Mono<TextChannel> |
getRulesChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the channel where "PUBLIC" guilds display rules and/or guidelines, if present, using
the given retrieval strategy.
|
Optional<Snowflake> |
getRulesChannelId()
Gets the id of the channel where "PUBLIC" guilds display rules and/or guidelines, if present.
|
Mono<Member> |
getSelfMember()
Requests to retrieve the member as represented by the bot user's ID.
|
Mono<Image> |
getSplash(Image.Format format)
Gets the splash of the guild.
|
Optional<String> |
getSplashUrl(Image.Format format)
Gets the splash URL of the guild, if present.
|
Mono<TextChannel> |
getSystemChannel()
Requests to retrieve the channel to which system messages are sent, if present.
|
Mono<TextChannel> |
getSystemChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the channel to which system messages are sent, if present, using the given retrieval
strategy.
|
EnumSet<Guild.SystemChannelFlag> |
getSystemChannelFlags()
Returns the flags of the system
channel . |
Optional<Snowflake> |
getSystemChannelId()
Gets the ID of the channel where guild notices such as welcome messages and boost events are posted, if present.
|
Optional<String> |
getVanityUrlCode()
Gets the vanity url code of the guild, if present.
|
Guild.VerificationLevel |
getVerificationLevel()
Gets the level of verification required for the guild.
|
Flux<VoiceState> |
getVoiceStates()
Requests to retrieve the voice states of the guild.
|
Flux<Webhook> |
getWebhooks()
Requests to retrieve the webhooks of the guild.
|
Mono<GuildChannel> |
getWidgetChannel()
Requests to retrieve the channel for the server widget, if present.
|
Mono<GuildChannel> |
getWidgetChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the channel for the server widget, if present, using the given retrieval strategy.
|
Optional<Snowflake> |
getWidgetChannelId()
Gets the channel ID that the widget will generate an invite to, if present.
|
int |
hashCode() |
boolean |
isEmbedEnabled()
Deprecated.
Use
Guild#isWidgetEnabled instead |
boolean |
isLarge()
Gets whether this guild is considered large.
|
boolean |
isUnavailable()
Gets whether this guild is unavailable.
|
boolean |
isWidgetEnabled()
Gets whether or not the server widget is enabled.
|
Mono<Void> |
kick(Snowflake userId)
Requests to kick the specified user from this guild.
|
Mono<Void> |
kick(Snowflake userId,
String reason)
Requests to kick the specified user from this guild while optionally specifying a reason.
|
Mono<Void> |
leave()
Requests to leave this guild.
|
Mono<Integer> |
prune(Consumer<? super GuildPruneSpec> spec)
Requests to prune users while customizing parameters.
|
Mono<Integer> |
prune(int days)
Requests to prune users.
|
Mono<Integer> |
prune(int days,
String reason)
Requests to prune users while optionally specifying a reason.
|
Flux<Member> |
requestMembers()
|
String |
toString() |
Mono<Void> |
unban(Snowflake userId)
Requests to unban the specified user.
|
Mono<Void> |
unban(Snowflake userId,
String reason)
Requests to unban the specified user while optionally specifying a reason.
|
public Guild(GatewayDiscordClient gateway, discord4j.discordjson.json.GuildData data)
Guild
with an associated ServiceMediator and Discord data.gateway
- The GatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.public GatewayDiscordClient getClient()
DiscordObject
GatewayDiscordClient
that created this object. Methods in it are exclusively based on the
entity cache or Store
in use. Refer to calling getClient().rest()
to access a
DiscordClient
that is capable of requesting entities directly from the REST API.getClient
in interface DiscordObject
GatewayDiscordClient
associated to this object.public Snowflake getId()
Entity
public String getName()
public Optional<String> getIconUrl(Image.Format format)
format
- The format for the URL.public Mono<Image> getIcon(Image.Format format)
public Optional<String> getSplashUrl(Image.Format format)
format
- The format for the URL.public Mono<Image> getSplash(Image.Format format)
public Optional<String> getDiscoverySplashUrl(Image.Format format)
format
- The format for the URL.public Mono<Image> getDiscoverySplash(Image.Format format)
format
- The format in which to get the image.Mono
where, upon successful completion, emits the discovery splash
of the guild.
If an error is received, it is emitted through the Mono
.public Optional<String> getBannerUrl(Image.Format format)
format
- The format for the URL.public Mono<Image> getBanner(Image.Format format)
public Snowflake getOwnerId()
public String getRegionId()
public Flux<Region> getRegions()
Flux
that continually emits the guild's voice regions
. If an error is received,
it is emitted through the Flux
.public Optional<Snowflake> getAfkChannelId()
public Mono<VoiceChannel> getAfkChannel()
public Mono<VoiceChannel> getAfkChannel(EntityRetrievalStrategy retrievalStrategy)
public int getAfkTimeout()
@Deprecated public Optional<Snowflake> getEmbedChannelId()
Guild#getWidgetChannelId
instead. For removal in v3.2public Mono<GuildChannel> getEmbedChannel()
public Mono<GuildChannel> getEmbedChannel(EntityRetrievalStrategy retrievalStrategy)
public Guild.PremiumTier getPremiumTier()
public OptionalInt getPremiumSubscriptionCount()
public Locale getPreferredLocale()
public Guild.VerificationLevel getVerificationLevel()
public Guild.NotificationLevel getNotificationLevel()
public Guild.ContentFilterLevel getContentFilterLevel()
public Set<Snowflake> getRoleIds()
public Flux<Role> getRoles()
The order of items emitted by the returned Flux
is unspecified. Use OrderUtil.orderRoles(Flux)
to consistently order roles.
public Flux<Role> getRoles(EntityRetrievalStrategy retrievalStrategy)
The order of items emitted by the returned Flux
is unspecified. Use OrderUtil.orderRoles(Flux)
to consistently order roles.
public Mono<Role> getRoleById(Snowflake id)
public Mono<Role> getRoleById(Snowflake id, EntityRetrievalStrategy retrievalStrategy)
public Mono<Role> getEveryoneRole()
Role
.public Mono<Role> getEveryoneRole(EntityRetrievalStrategy retrievalStrategy)
Role
, using the given retrieval strategy.public Set<Snowflake> getEmojiIds()
public Flux<GuildEmoji> getEmojis()
public Flux<GuildEmoji> getEmojis(EntityRetrievalStrategy retrievalStrategy)
public Mono<GuildEmoji> getGuildEmojiById(Snowflake id)
id
- The ID of the guild emoji.Mono
where, upon successful completion, emits the GuildEmoji
as represented by the
supplied ID. If an error is received, it is emitted through the Mono
.public Mono<GuildEmoji> getGuildEmojiById(Snowflake id, EntityRetrievalStrategy retrievalStrategy)
id
- The ID of the guild emoji.retrievalStrategy
- the strategy to use to get the guild emojiMono
where, upon successful completion, emits the GuildEmoji
as represented by the
supplied ID. If an error is received, it is emitted through the Mono
.public Set<String> getFeatures()
public Guild.MfaLevel getMfaLevel()
public Optional<Snowflake> getApplicationId()
public boolean isWidgetEnabled()
public Optional<Snowflake> getWidgetChannelId()
public Mono<GuildChannel> getWidgetChannel()
public Mono<GuildChannel> getWidgetChannel(EntityRetrievalStrategy retrievalStrategy)
public Optional<Snowflake> getSystemChannelId()
public Mono<TextChannel> getSystemChannel()
public Mono<TextChannel> getSystemChannel(EntityRetrievalStrategy retrievalStrategy)
public EnumSet<Guild.SystemChannelFlag> getSystemChannelFlags()
channel
.EnumSet
with the flags of the system channel
.public Optional<Snowflake> getRulesChannelId()
public Mono<TextChannel> getRulesChannel()
public Mono<TextChannel> getRulesChannel(EntityRetrievalStrategy retrievalStrategy)
public Optional<Snowflake> getPublicUpdatesChannelId()
public Mono<TextChannel> getPublicUpdatesChannel()
public Mono<TextChannel> getPublicUpdatesChannel(EntityRetrievalStrategy retrievalStrategy)
public Optional<Integer> getMaxVideoChannelUsers()
public Instant getJoinTime()
Guild
object was retrieved
using REST API, then calling this method will throw DateTimeParseException
.public boolean isLarge()
Guild
object was retrieved
using REST API, then calling this method will always return false
.true
if the guild is considered large, false
otherwise.public boolean isUnavailable()
true
if the guild is unavailable, false
otherwise.@Deprecated public boolean isEmbedEnabled()
Guild#isWidgetEnabled
insteadpublic int getMemberCount()
Guild
object was
retrieved
using REST API, then calling this method will always return the same
value.public Flux<VoiceState> getVoiceStates()
Flux
that continually emits the voice states
of the guild. If an error is
received, it is emitted through the Flux
.public Flux<Member> getMembers(EntityRetrievalStrategy retrievalStrategy)
public Mono<Member> getMemberById(Snowflake id)
public Mono<Member> getMemberById(Snowflake id, EntityRetrievalStrategy retrievalStrategy)
public Mono<Member> getSelfMember()
public Flux<GuildChannel> getChannels()
The order of items emitted by the returned Flux
is unspecified. Use
OrderUtil.orderGuildChannels(Flux)
to consistently order channels.
public Flux<GuildChannel> getChannels(EntityRetrievalStrategy retrievalStrategy)
The order of items emitted by the returned Flux
is unspecified. Use
OrderUtil.orderGuildChannels(Flux)
to consistently order channels.
public Mono<GuildChannel> getChannelById(Snowflake id)
id
- The ID of the channel.Mono
where, upon successful completion, emits the GuildChannel
as represented by the
supplied ID. If an error is received, it is emitted through the Mono
.public Mono<GuildChannel> getChannelById(Snowflake id, EntityRetrievalStrategy retrievalStrategy)
id
- The ID of the channel.retrievalStrategy
- the strategy to use to get the channelMono
where, upon successful completion, emits the GuildChannel
as represented by the
supplied ID. If an error is received, it is emitted through the Mono
.public Optional<String> getVanityUrlCode()
public Optional<String> getDescription()
public int getMaxPresences()
public OptionalInt getMaxMembers()
public Mono<Guild> edit(Consumer<? super GuildEditSpec> spec)
spec
- A Consumer
that provides a "blank" GuildEditSpec
to be operated on.Mono
where, upon successful completion, emits the edited Guild
. If an error is
received, it is emitted through the Mono
.public Mono<GuildEmoji> createEmoji(Consumer<? super GuildEmojiCreateSpec> spec)
spec
- A Consumer
that provides a "blank" GuildEmojiCreateSpec
to be operated on.Mono
where, upon successful completion, emits the created GuildEmoji
. If an error is
received, it is emitted through the Mono
.public Mono<Role> createRole(Consumer<? super RoleCreateSpec> spec)
spec
- A Consumer
that provides a "blank" RoleCreateSpec
to be operated on.Mono
where, upon successful completion, emits the created Role
. If an error is
received, it is emitted through the Mono
.public Mono<NewsChannel> createNewsChannel(Consumer<? super NewsChannelCreateSpec> spec)
spec
- A Consumer
that provides a "blank" NewsChannelCreateSpec
to be operated on.Mono
where, upon successful completion, emits the created NewsChannel
. If an error is
received, it is emitted through the Mono
.public Mono<Category> createCategory(Consumer<? super CategoryCreateSpec> spec)
spec
- A Consumer
that provides a "blank" CategoryCreateSpec
to be operated on.Mono
where, upon successful completion, emits the created Category
. If an error is
received, it is emitted through the Mono
.public Mono<TextChannel> createTextChannel(Consumer<? super TextChannelCreateSpec> spec)
spec
- A Consumer
that provides a "blank" TextChannelCreateSpec
to be operated on.Mono
where, upon successful completion, emits the created TextChannel
. If an error is
received, it is emitted through the Mono
.public Mono<VoiceChannel> createVoiceChannel(Consumer<? super VoiceChannelCreateSpec> spec)
spec
- A Consumer
that provides a "blank" VoiceChannelCreateSpec
to be operated on.Mono
where, upon successful completion, emits the created VoiceChannel
. If an error is
received, it is emitted through the Mono
.public Mono<Void> delete()
Mono
where, upon successful completion, emits nothing; indicating the guild has been deleted.
If an error is received, it is emitted through the Mono
.public Mono<Void> kick(Snowflake userId)
userId
- The ID of the user to kick from this guild.Mono
where, upon successful completion, emits nothing; indicating the specified user was kicked
from this guild. If an error is received, it is emitted through the Mono
.public Mono<Void> kick(Snowflake userId, @Nullable String reason)
userId
- The ID of the user to kick from this guild.reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the specified user was kicked
from this guild. If an error is received, it is emitted through the Mono
.public Mono<Ban> getBan(Snowflake userId)
public Mono<Void> ban(Snowflake userId, Consumer<? super BanQuerySpec> spec)
userId
- The ID of the user to ban.spec
- A Consumer
that provides a "blank" BanQuerySpec
to be operated on.Mono
where, upon successful completion, emits nothing; indicating the specified user was
banned. If an error is received, it is emitted through the Mono
.public Mono<Void> unban(Snowflake userId)
userId
- The ID of the user to unban.Mono
where, upon successful completion, emits nothing; indicating the specified user was
unbanned. If an error is received, it is emitted through the Mono
.public Mono<Void> unban(Snowflake userId, @Nullable String reason)
userId
- The ID of the user to unban.reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the specified user was
unbanned. If an error is received, it is emitted through the Mono
.public Mono<Integer> getPruneCount(int days)
days
- The number of days since an user must have been seen to avoid being kicked.Mono
where, upon successful completion, emits the number of users that will be pruned. If an
error is received, it is emitted through the Mono
.public Mono<Integer> getPruneCount(Consumer<? super GuildPruneCountSpec> spec)
GuildPruneCountSpec.addRole(Snowflake)
or GuildPruneCountSpec.addRoles(Collection)
.spec
- A Consumer
that provides a "blank" GuildPruneCountSpec
to be operated on.Mono
where, upon successful completion, emits the number of users that will be pruned. If an
error is received, it is emitted through the Mono
.public Mono<Integer> prune(int days)
days
- The number of days since an user must have been seen to avoid being kicked.Mono
where, upon successful completion, emits the number of users who were pruned. If an error
is received, it is emitted through the Mono
.public Mono<Integer> prune(int days, @Nullable String reason)
days
- The number of days since an user must have been seen to avoid being kicked.reason
- The reason, if present.Mono
where, upon successful completion, emits the number of users who were pruned. If an error
is received, it is emitted through the Mono
.public Mono<Integer> prune(Consumer<? super GuildPruneSpec> spec)
GuildPruneSpec.addRole(Snowflake)
or GuildPruneSpec.addRoles(Collection)
.spec
- A Consumer
that provides a "blank" GuildPruneSpec
to be operated on.Mono
where, upon successful completion, may emit the number of users who were pruned if
GuildPruneSpec.setComputePruneCount(boolean)
is true
(default), otherwise it would emit an
empty Mono
. If an error is received, it is emitted through the Mono
.public Mono<Void> leave()
Mono
where, upon successful completion, emits nothing; indicating this guild has been left. If
an error is received, it is emitted through the Mono
.public Flux<AuditLogEntry> getAuditLog()
Flux
that continually emits entries for this guild's audit log. If an error is received, it is
emitted through the Flux
.public Flux<AuditLogEntry> getAuditLog(Consumer<? super AuditLogQuerySpec> spec)
spec
- A Consumer
that provides a "blank" AuditLogQuerySpec
to be operated on.Flux
that continually emits entries for this guild's audit log. If an error is received, it is
emitted through the Flux
.public Flux<ExtendedInvite> getInvites()
public Mono<String> changeSelfNickname(@Nullable String nickname)
nickname
- The new nickname for the bot user in this guild, or null
to remove it.Mono
where, upon successful completion, emits the bot user's new nickname in this guild. If
the nickname was set to null
, then this Mono
will complete empty. If an error is received, it
is emitted through the Mono
.