Class Guild
- All Implemented Interfaces:
DiscordObject
,Entity
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Automatically scan and delete messages sent in the server that contain explicit content.static enum
Prevent potentially dangerous administrative actions for users without two-factor authentication enabled.static enum
Determines whetherMembers
who have not explicitly set their notification settings receive a notification for every message sent in the server or not.static enum
static enum
Represent the server Premium Tier (aka boost level) of theGuild
.static enum
Describes system channel flags.static enum
Members
of the server must meet the following criteria before they can send messages in text channels or initiate a direct message conversation. -
Constructor Summary
ConstructorDescriptionGuild
(GatewayDiscordClient gateway, discord4j.discordjson.json.GuildData data) Constructs aGuild
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptiondiscord4j.core.spec.GuildBanQueryMono
Requests to ban the specified user.Requests to ban the specified user.ban
(Snowflake userId, Consumer<? super LegacyBanQuerySpec> spec) Deprecated.changeSelfNickname
(String nickname) Requests to change the bot user's nickname in this guild.createAutoModRule
(discord4j.core.spec.AutoModRuleCreateSpec spec) Requests to create an AutoMod Rule.discord4j.core.spec.AutoModRuleCreateMono
createAutoModRule
(String name, AutoModRule.EventType eventType, AutoModRule.TriggerType triggerType) Requests to create an automod rule.createCategory
(discord4j.core.spec.CategoryCreateSpec spec) Requests to create a category.discord4j.core.spec.CategoryCreateMono
createCategory
(String name) Requests to create a category.createCategory
(Consumer<? super LegacyCategoryCreateSpec> spec) Deprecated.usecreateCategory(CategoryCreateSpec)
orcreateCategory(String)
which offer an immutable approach to build specscreateEmoji
(discord4j.core.spec.GuildEmojiCreateSpec spec) Requests to create an emoji.discord4j.core.spec.GuildEmojiCreateMono
createEmoji
(String name, Image image) Requests to create an emoji.createEmoji
(Consumer<? super LegacyGuildEmojiCreateSpec> spec) Deprecated.usecreateEmoji(GuildEmojiCreateSpec)
orcreateEmoji(String, Image)
which offer an immutable approach to build specscreateForumChannel
(discord4j.core.spec.ForumChannelCreateSpec spec) Requests to create a forum channel.createNewsChannel
(discord4j.core.spec.NewsChannelCreateSpec spec) Requests to create a news channel.discord4j.core.spec.NewsChannelCreateMono
createNewsChannel
(String name) Requests to create a news channel.createNewsChannel
(Consumer<? super LegacyNewsChannelCreateSpec> spec) Deprecated.usecreateNewsChannel(NewsChannelCreateSpec)
orcreateNewsChannel(String)
which offer an immutable approach to build specsdiscord4j.core.spec.RoleCreateMono
Requests to create a role.createRole
(discord4j.core.spec.RoleCreateSpec spec) Requests to create a role.createRole
(Consumer<? super LegacyRoleCreateSpec> spec) Deprecated.usecreateRole(RoleCreateSpec)
orcreateRole()
which offer an immutable approach to build specscreateScheduledEvent
(discord4j.core.spec.ScheduledEventCreateSpec spec) Requests to create a guild scheduled event with the provided spec on this guildcreateStageChannel
(discord4j.core.spec.StageChannelCreateSpec spec) Requests to create a stage channel.createSticker
(discord4j.core.spec.GuildStickerCreateSpec spec) Requests to create a sticker.createTemplate
(discord4j.core.spec.GuildTemplateCreateSpec spec) Requests to create a template based on this guild.discord4j.core.spec.GuildTemplateCreateMono
createTemplate
(String name) Requests to create a template based on this guild.createTemplate
(Consumer<? super LegacyGuildTemplateCreateSpec> spec) Deprecated.usecreateTemplate(GuildTemplateCreateSpec)
orcreateTemplate(String)
which offer an immutable approach to build specscreateTextChannel
(discord4j.core.spec.TextChannelCreateSpec spec) Requests to create a text channel.discord4j.core.spec.TextChannelCreateMono
createTextChannel
(String name) Requests to create a text channel.createTextChannel
(Consumer<? super LegacyTextChannelCreateSpec> spec) Deprecated.usecreateTextChannel(TextChannelCreateSpec)
orcreateTextChannel(String)
which offer an immutable approach to build specscreateVoiceChannel
(discord4j.core.spec.VoiceChannelCreateSpec spec) Requests to create a voice channel.discord4j.core.spec.VoiceChannelCreateMono
createVoiceChannel
(String name) Requests to create a voice channel.createVoiceChannel
(Consumer<? super LegacyVoiceChannelCreateSpec> spec) Deprecated.usecreateVoiceChannel(VoiceChannelCreateSpec)
orcreateVoiceChannel(String)
which offer an immutable approach to build specsdelete()
Requests to delete this guild.discord4j.core.spec.GuildEditMono
edit()
Requests to edit this guild.edit
(discord4j.core.spec.GuildEditSpec spec) Requests to edit this guild.edit
(Consumer<? super LegacyGuildEditSpec> spec) Deprecated.useedit(GuildEditSpec)
oredit()
which offer an immutable approach to build specsboolean
Requests to retrieve the active threads of the guild.Requests to retrieve the AFK channel, if present.getAfkChannel
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the AFK channel, if present, using the given retrieval strategy.Gets the ID of the AFK channel, if present.int
Gets the AFK timeout in seconds.Gets the application ID of the guild creator if it is bot-created.discord4j.core.spec.AuditLogQueryFlux
Requests to retrieve the audit log for this guild.getAuditLog
(discord4j.core.spec.AuditLogQuerySpec spec) Requests to retrieve the audit log for this guild.getAuditLog
(Consumer<? super LegacyAuditLogQuerySpec> spec) Deprecated.usegetAuditLog(AuditLogQuerySpec)
orgetAuditLog()
which offer an immutable approach to build specsgetAutoModRule
(Snowflake autoModRuleId) Requests to retrieve the automod rule of the guild using the ID.Requests to retrieve the automod rules of the guild.Requests to retrieve the ban for the specified user for this guild.getBanner
(Image.Format format) Gets the banner of the guild.getBannerUrl
(Image.Format format) Gets the banner URL of the guild, if present.getBans()
Requests to retrieve all the bans for this guild.Requests to retrieve the channel as represented by the supplied ID.getChannelById
(Snowflake id, EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the channel as represented by the supplied ID, using the given retrieval strategy.Requests to retrieve the guild's channels.getChannels
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild's channels, using the given retrieval strategy.Returns theGatewayDiscordClient
that created this object.Gets the default explicit content filter level.discord4j.discordjson.json.GuildData
getData()
Gets the data of the guild.Gets the description of the guild, if present.getDiscoverySplash
(Image.Format format) Gets the discovery splash of the guild.getDiscoverySplashUrl
(Image.Format format) Gets the discovery splash URL of the guild, if present.Gets the guild's emoji's IDs.Requests to retrieve the guild's emojis.getEmojis
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild's emojis, using the given retrieval strategy.Requests to retrieve the guild's @everyoneRole
.getEveryoneRole
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild's @everyoneRole
, using the given retrieval strategy.Gets the enabled guild features.Requests to retrieve the guild emoji as represented by the supplied ID.getGuildEmojiById
(Snowflake id, EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild emoji as represented by the supplied ID, using the given retrieval strategy.Requests to retrieve the guild sticker as represented by the supplied ID.getGuildStickerById
(Snowflake id, EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild sticker as represented by the supplied ID, using the given retrieval strategy.getIcon
(Image.Format format) Gets the icon of the guild.getIconUrl
(Image.Format format) Gets the icon URL of the guild, if present.getId()
Gets the Snowflake that uniquely identifies this entity.Requests to retrieve the invites of the guild.Gets when this guild was joined at.Gets the maximum amount of members of the guild, if present.int
Gets the maximum amount of presences of the guild.Gets the maximum amount of users in a video channel, if present.Requests to retrieve the member as represented by the supplied ID.getMemberById
(Snowflake id, EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the member as represented by the supplied ID, using the given retrieval strategy.int
Gets the total number of members in the guild.Requests to retrieve the members of the guild.getMembers
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the members of the guild, using the given retrieval strategy.Gets the required MFA level for the guild.getName()
Gets the guild name.Gets the default message notification level..Gets the guild NSFW level.getOwner()
Requests to retrieve the owner of the guild.Gets the ID of the owner of the guild.Gets the preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US".Gets the number of boosts this server currently has, if present.Gets the Premium Tier (Server Boost level) for the guild.Requests to retrieve the presences of the guild.discord4j.core.spec.GuildPruneCountMono
getPruneCount
(int days) Requests to retrieve the number of users that will be pruned.getPruneCount
(discord4j.core.spec.GuildPruneCountSpec spec) Requests to retrieve the number of users that will be pruned.getPruneCount
(Consumer<? super LegacyGuildPruneCountSpec> spec) Deprecated.usegetPruneCount(GuildPruneCountSpec)
orgetPruneCount(int)
which offer an immutable approach to build specsRequests to retrieve the channel where admins and moderators of Community guilds receive notices from Discord, if present.getPublicUpdatesChannel
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the channel where admins and moderators of Community guilds receive notices from Discord, if present, using the given retrieval strategy.Gets the id of the channel where admins and moderators of Community guilds receive notices from Discord, if present.Deprecated.Voice regions are now specific to voice channels.Deprecated.Voice region are now specific to voice channels.Requests to retrieve the voice regions for the guild.getRoleById
(Snowflake id) Requests to retrieve the role as represented by the supplied ID.getRoleById
(Snowflake id, EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the role as represented by the supplied ID, using the given retrieval strategy.Gets the guild's roles' IDs.getRoles()
Requests to retrieve the guild's roles.getRoles
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild's roles, using the given retrieval strategy.Requests to retrieve the channel where Community guilds display rules and/or guidelines, if present.getRulesChannel
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the channel where Community guilds display rules and/or guidelines, if present, using the given retrieval strategy.Gets the id of the channel where Community guilds display rules and/or guidelines, if present.Gets the id of the channel where admins and moderators of Community guilds receive safety alerts from Discord, if present.getScheduledEventById
(Snowflake eventId, boolean withUserCount) Requests to retrieve the scheduled event using the provided ID.getScheduledEvents
(boolean withUserCount) Requests to retrieve all the scheduled events associated to this guild.Requests to retrieve the member as represented by the bot user's ID.getSplash
(Image.Format format) Gets the splash of the guild.getSplashUrl
(Image.Format format) Gets the splash URL of the guild, if present.Gets the guild's sticker's IDs.Requests to retrieve the guild's stickers.getStickers
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild's stickers, using the given retrieval strategy.Requests to retrieve the channel to which system messages are sent, if present.getSystemChannel
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the channel to which system messages are sent, if present, using the given retrieval strategy.Returns the flags of the systemchannel
.Gets the ID of the channel where guild notices such as welcome messages and boost events are posted, if present.Requests to retrieve the templates of the guild.Gets the vanity url code of the guild, if present.Gets the level of verification required for the guild.Returns the current voice connection registered for this guild.Requests to retrieve the voice states of the guild.Requests to retrieve the webhooks of the guild.Requests to retrieve the channel for the server widget, if present.getWidgetChannel
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the channel for the server widget, if present, using the given retrieval strategy.Gets the channel ID that the widget will generate an invite to, if present.int
hashCode()
boolean
Deprecated.UseGuild#isWidgetEnabled
insteadboolean
isLarge()
Gets whether this guild is considered large.boolean
isNsfw()
Deprecated.UsegetNsfwLevel()
insteadboolean
Gets whether this guild is unavailable.boolean
Gets whether or not the server widget is enabled.Requests to kick the specified user from this guild.Requests to kick the specified user from this guild while optionally specifying a reason.leave()
Requests to leave this guild.discord4j.core.spec.GuildPruneMono
prune
(int days) Requests to prune users.prune
(discord4j.core.spec.GuildPruneSpec spec) Requests to prune users while customizing parameters.prune
(Consumer<? super LegacyGuildPruneSpec> spec) Deprecated.useprune(GuildPruneSpec)
orprune(int)
which offer an immutable approach to build specsrequestMembers
(Set<Snowflake> userIds) Return a set ofmembers
from this guild using the current Gateway connection.searchMembers
(String username, int limit) Returns a list ofmembers
whose username or nickname starts with the provided username.toString()
Requests to unban the specified user.Requests to unban the specified user while optionally specifying a reason.
-
Constructor Details
-
Guild
Constructs aGuild
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Details
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getId
Description copied from interface:Entity
Gets the Snowflake that uniquely identifies this entity. -
getData
public discord4j.discordjson.json.GuildData getData()Gets the data of the guild.- Returns:
- The data of the guild.
-
getName
Gets the guild name.- Returns:
- The guild name.
-
getIconUrl
Gets the icon URL of the guild, if present.- Parameters:
format
- The format for the URL.- Returns:
- The icon URL of the guild, if present.
-
getIcon
Gets the icon of the guild. -
getSplashUrl
Gets the splash URL of the guild, if present.- Parameters:
format
- The format for the URL.- Returns:
- The splash URL of the guild, if present.
-
getSplash
Gets the splash of the guild. -
getDiscoverySplashUrl
Gets the discovery splash URL of the guild, if present.- Parameters:
format
- The format for the URL.- Returns:
- The discovery splash URL of the guild, if present.
-
getDiscoverySplash
Gets the discovery splash of the guild.- Parameters:
format
- The format in which to get the image.- Returns:
- A
Mono
where, upon successful completion, emits thediscovery splash
of the guild. If an error is received, it is emitted through theMono
.
-
getBannerUrl
Gets the banner URL of the guild, if present.- Parameters:
format
- The format for the URL.- Returns:
- The banner URL of the guild, if present.
-
getBanner
Gets the banner of the guild. -
getOwnerId
Gets the ID of the owner of the guild.- Returns:
- The ID of the owner of the guild.
-
getOwner
Requests to retrieve the owner of the guild. -
getRegionId
Deprecated.Voice region are now specific to voice channels. UseVoiceChannel#getRtcRegion
instead.Gets the voice region ID for the guild.- Returns:
- The voice region ID for the guild.
-
getRegion
Deprecated.Voice regions are now specific to voice channels. UseVoiceChannel#getRtcRegion
instead.Requests to retrieve the voice region for the guild. -
getRegions
Requests to retrieve the voice regions for the guild.- Returns:
- A
Flux
that continually emits the guild'svoice regions
. If an error is received, it is emitted through theFlux
.
-
getAfkChannelId
Gets the ID of the AFK channel, if present.- Returns:
- The ID of the AFK channel, if present.
-
getAfkChannel
Requests to retrieve the AFK channel, if present. -
getAfkChannel
Requests to retrieve the AFK channel, if present, using the given retrieval strategy. -
getAfkTimeout
public int getAfkTimeout()Gets the AFK timeout in seconds.- Returns:
- The AFK timeout in seconds.
-
getPremiumTier
Gets the Premium Tier (Server Boost level) for the guild.- Returns:
- The Premium Tier (Server Boost level) for the guild.
-
getPremiumSubscriptionCount
Gets the number of boosts this server currently has, if present.- Returns:
- The number of boosts this server currently has, if present.
-
getPreferredLocale
Gets the preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US".- Returns:
- The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US".
-
getVerificationLevel
Gets the level of verification required for the guild.- Returns:
- The level of verification required for the guild.
-
getNotificationLevel
Gets the default message notification level..- Returns:
- The default message notification level.
-
getContentFilterLevel
Gets the default explicit content filter level.- Returns:
- The default explicit content filter level.
-
getRoleIds
Gets the guild's roles' IDs.- Returns:
- The guild's roles' IDs.
-
getRoles
Requests to retrieve the guild's roles.The order of items emitted by the returned
Flux
is unspecified. UseOrderUtil.orderRoles(Flux)
to consistently order roles. -
getRoles
Requests to retrieve the guild's roles, using the given retrieval strategy.The order of items emitted by the returned
Flux
is unspecified. UseOrderUtil.orderRoles(Flux)
to consistently order roles. -
getRoleById
Requests to retrieve the role as represented by the supplied ID. -
getRoleById
Requests to retrieve the role as represented by the supplied ID, using the given retrieval strategy. -
getEveryoneRole
Requests to retrieve the guild's @everyoneRole
. -
getEveryoneRole
Requests to retrieve the guild's @everyoneRole
, using the given retrieval strategy. -
getStickerIds
Gets the guild's sticker's IDs.- Returns:
- The guild's sticker's IDs.
-
getStickers
Requests to retrieve the guild's stickers. -
getEmojiIds
Gets the guild's emoji's IDs.- Returns:
- The guild's emoji's IDs.
-
getStickers
Requests to retrieve the guild's stickers, using the given retrieval strategy. -
getGuildStickerById
Requests to retrieve the guild sticker as represented by the supplied ID.- Parameters:
id
- The ID of the guild sticker.- Returns:
- A
Mono
where, upon successful completion, emits theGuildSticker
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getGuildStickerById
public Mono<GuildSticker> getGuildStickerById(Snowflake id, EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild sticker as represented by the supplied ID, using the given retrieval strategy.- Parameters:
id
- The ID of the guild sticker.retrievalStrategy
- the strategy to use to get the guild sticker- Returns:
- A
Mono
where, upon successful completion, emits theGuildSticker
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getEmojis
Requests to retrieve the guild's emojis. -
getEmojis
Requests to retrieve the guild's emojis, using the given retrieval strategy. -
getGuildEmojiById
Requests to retrieve the guild emoji as represented by the supplied ID.- Parameters:
id
- The ID of the guild emoji.- Returns:
- A
Mono
where, upon successful completion, emits theGuildEmoji
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getGuildEmojiById
Requests to retrieve the guild emoji as represented by the supplied ID, using the given retrieval strategy.- Parameters:
id
- The ID of the guild emoji.retrievalStrategy
- the strategy to use to get the guild emoji- Returns:
- A
Mono
where, upon successful completion, emits theGuildEmoji
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getFeatures
Gets the enabled guild features.
You can see the available guild features- Returns:
- The enabled guild features.
-
getMfaLevel
Gets the required MFA level for the guild.- Returns:
- The required MFA level for the guild.
-
getApplicationId
Gets the application ID of the guild creator if it is bot-created.- Returns:
- The application ID of the guild creator if it is bot-created.
-
isWidgetEnabled
public boolean isWidgetEnabled()Gets whether or not the server widget is enabled.- Returns:
- Whether or not the server widget is enabled.
-
getWidgetChannelId
Gets the channel ID that the widget will generate an invite to, if present.- Returns:
- The channel ID that the widget will generate an invite to, if present.
-
getWidgetChannel
Requests to retrieve the channel for the server widget, if present. -
getWidgetChannel
Requests to retrieve the channel for the server widget, if present, using the given retrieval strategy. -
getSystemChannelId
Gets the ID of the channel where guild notices such as welcome messages and boost events are posted, if present.- Returns:
- The ID of the channel where guild notices such as welcome messages and boost events are posted, if present.
-
getSystemChannel
Requests to retrieve the channel to which system messages are sent, if present. -
getSystemChannel
Requests to retrieve the channel to which system messages are sent, if present, using the given retrieval strategy. -
getSystemChannelFlags
Returns the flags of the systemchannel
.- Returns:
- A
EnumSet
with the flags of the systemchannel
.
-
getRulesChannelId
Gets the id of the channel where Community guilds display rules and/or guidelines, if present.- Returns:
- The id of the channel where Community guilds display rules and/or guidelines, if present.
-
getRulesChannel
Requests to retrieve the channel where Community guilds display rules and/or guidelines, if present. -
getRulesChannel
Requests to retrieve the channel where Community guilds display rules and/or guidelines, if present, using the given retrieval strategy. -
getPublicUpdatesChannelId
Gets the id of the channel where admins and moderators of Community guilds receive notices from Discord, if present.- Returns:
- The id of the channel where admins and moderators of Community guilds receive notices from Discord, if present.
-
getPublicUpdatesChannel
Requests to retrieve the channel where admins and moderators of Community guilds receive notices from Discord, if present. -
getPublicUpdatesChannel
Requests to retrieve the channel where admins and moderators of Community guilds receive notices from Discord, if present, using the given retrieval strategy. -
getSafetyAlertsChannelId
Gets the id of the channel where admins and moderators of Community guilds receive safety alerts from Discord, if present.- Returns:
- The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord, if present.
-
getMaxVideoChannelUsers
Gets the maximum amount of users in a video channel, if present.- Returns:
- The maximum amount of users in a video channel, if present.
-
getJoinTime
Gets when this guild was joined at. If thisGuild
object wasretrieved
using REST API, then calling this method will throwDateTimeParseException
.- Returns:
- When this guild was joined at.
-
isLarge
public boolean isLarge()Gets whether this guild is considered large. If thisGuild
object wasretrieved
using REST API, then calling this method will always returnfalse
.- Returns:
- If present,
true
if the guild is considered large,false
otherwise.
-
isEmbedEnabled
Deprecated.UseGuild#isWidgetEnabled
insteadGets whether this guild is embeddable (e.g. widget).- Returns:
- Whether this guild is embeddable (e.g. widget).
-
getMemberCount
public int getMemberCount()Gets the total number of members in the guild. If thisGuild
object wasretrieved
using REST API, then calling this method will always return the same value.- Returns:
- The total number of members in the guild.
-
isNsfw
Deprecated.UsegetNsfwLevel()
insteadGets whether this guild is designated as NSFW.- Returns:
- Whether this guild is designated as NSFW.
-
getNsfwLevel
Gets the guild NSFW level.- Returns:
- The guild NSFW level.
-
getVoiceStates
Requests to retrieve the voice states of the guild.- Returns:
- A
Flux
that continually emits thevoice states
of the guild. If an error is received, it is emitted through theFlux
.
-
getMembers
Requests to retrieve the members of the guild. -
getMembers
Requests to retrieve the members of the guild, using the given retrieval strategy. -
requestMembers
-
requestMembers
Return a set ofmembers
from this guild using the current Gateway connection. This method performs a check to validate whether the given guild's data can be obtained from thisGatewayDiscordClient
. -
searchMembers
Returns a list ofmembers
whose username or nickname starts with the provided username. -
getMemberById
Requests to retrieve the member as represented by the supplied ID. -
getMemberById
Requests to retrieve the member as represented by the supplied ID, using the given retrieval strategy. -
getSelfMember
Requests to retrieve the member as represented by the bot user's ID. -
getChannels
Requests to retrieve the guild's channels.The order of items emitted by the returned
Flux
is unspecified. UseOrderUtil.orderGuildChannels(Flux)
to consistently order channels. -
getChannels
Requests to retrieve the guild's channels, using the given retrieval strategy.The order of items emitted by the returned
Flux
is unspecified. UseOrderUtil.orderGuildChannels(Flux)
to consistently order channels. -
getChannelById
Requests to retrieve the channel as represented by the supplied ID.- Parameters:
id
- The ID of the channel.- Returns:
- A
Mono
where, upon successful completion, emits theGuildChannel
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getChannelById
Requests to retrieve the channel as represented by the supplied ID, using the given retrieval strategy.- Parameters:
id
- The ID of the channel.retrievalStrategy
- the strategy to use to get the channel- Returns:
- A
Mono
where, upon successful completion, emits theGuildChannel
as represented by the supplied ID. If an error is received, it is emitted through theMono
.
-
getPresences
Requests to retrieve the presences of the guild. -
getVanityUrlCode
Gets the vanity url code of the guild, if present.- Returns:
- The vanity url code of the guild, if present.
-
getDescription
Gets the description of the guild, if present.- Returns:
- The description of the guild, if present.
-
getMaxPresences
public int getMaxPresences()Gets the maximum amount of presences of the guild.- Returns:
- The maximum amount of presences for the guild.
-
getMaxMembers
Gets the maximum amount of members of the guild, if present.- Returns:
- The maximum amount of members for the guild, if present.
-
edit
Deprecated.useedit(GuildEditSpec)
oredit()
which offer an immutable approach to build specsRequests to edit this guild.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyGuildEditSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the editedGuild
. If an error is received, it is emitted through theMono
.
-
edit
public discord4j.core.spec.GuildEditMono edit()Requests to edit this guild. Properties specifying how to edit this guild can be set via thewithXxx
methods of the returnedGuildEditMono
.- Returns:
- A
GuildEditMono
where, upon successful completion, emits the editedGuild
. If an error is received, it is emitted through theGuildEditMono
.
-
edit
Requests to edit this guild. -
createEmoji
Deprecated.usecreateEmoji(GuildEmojiCreateSpec)
orcreateEmoji(String, Image)
which offer an immutable approach to build specsRequests to create an emoji.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyGuildEmojiCreateSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the createdGuildEmoji
. If an error is received, it is emitted through theMono
.
-
createEmoji
Requests to create an emoji. Properties specifying how to create an emoji can be set via thewithXxx
methods of the returnedGuildEmojiCreateMono
.- Parameters:
name
- the name of the emoji to createimage
- the image of the emoji to create- Returns:
- A
GuildEmojiCreateMono
where, upon successful completion, emits the createdGuildEmoji
. If an error is received, it is emitted through theGuildEmojiCreateMono
.
-
createEmoji
Requests to create an emoji.- Parameters:
spec
- an immutable object that specifies how to create the emoji- Returns:
- A
Mono
where, upon successful completion, emits the createdGuildEmoji
. If an error is received, it is emitted through theMono
.
-
createSticker
Requests to create a sticker.- Parameters:
spec
- an immutable object that specifies how to create the sticker- Returns:
- A
Mono
where, upon successful completion, emits the createdGuildSticker
. If an error is received, it is emitted through theMono
.
-
createTemplate
@Deprecated public Mono<GuildTemplate> createTemplate(Consumer<? super LegacyGuildTemplateCreateSpec> spec) Deprecated.usecreateTemplate(GuildTemplateCreateSpec)
orcreateTemplate(String)
which offer an immutable approach to build specsRequests to create a template based on this guild.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyGuildTemplateCreateSpec
to be operated on.- Returns:
- A
Mono
where, upon subscription, emits the createdGuildTemplate
on success. If an error is received, it is emitted through theMono
.
-
createTemplate
Requests to create a template based on this guild. A description for this template can be set via theGuildTemplateCreateMono.withDescriptionOrNull(String)
method of the returnedGuildTemplateCreateMono
.- Parameters:
name
- the name of the template to create- Returns:
- A
Mono
where, upon subscription, emits the createdGuildTemplate
on success. If an error is received, it is emitted through theMono
.
-
createTemplate
Requests to create a template based on this guild.- Parameters:
spec
- an immutable object that specifies how to create a template for this guild- Returns:
- A
Mono
where, upon subscription, emits the createdGuildTemplate
on success. If an error is received, it is emitted through theMono
.
-
createRole
Deprecated.usecreateRole(RoleCreateSpec)
orcreateRole()
which offer an immutable approach to build specsRequests to create a role.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyRoleCreateSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the createdRole
. If an error is received, it is emitted through theMono
.
-
createRole
public discord4j.core.spec.RoleCreateMono createRole()Requests to create a role. Properties specifying how to create the role can be set via thewithXxx
methods of the returnedRoleCreateMono
.- Returns:
- A
RoleCreateMono
where, upon successful completion, emits the createdRole
. If an error is received, it is emitted through theRoleCreateMono
.
-
createRole
Requests to create a role. -
createNewsChannel
@Deprecated public Mono<NewsChannel> createNewsChannel(Consumer<? super LegacyNewsChannelCreateSpec> spec) Deprecated.usecreateNewsChannel(NewsChannelCreateSpec)
orcreateNewsChannel(String)
which offer an immutable approach to build specsRequests to create a news channel.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyNewsChannelCreateSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the createdNewsChannel
. If an error is received, it is emitted through theMono
.
-
createNewsChannel
Requests to create a news channel. Properties specifying how to create the news channel can be set via thewithXxx
methods of the returnedNewsChannelCreateMono
.- Parameters:
name
- the name of the news channel to create- Returns:
- A
NewsChannelCreateMono
where, upon successful completion, emits the createdNewsChannel
. If an error is received, it is emitted through theNewsChannelCreateMono
.
-
createNewsChannel
Requests to create a news channel.- Parameters:
spec
- an immutable object that specifies how to create the news channel- Returns:
- A
Mono
where, upon successful completion, emits the createdNewsChannel
. If an error is received, it is emitted through theMono
.
-
createCategory
Deprecated.usecreateCategory(CategoryCreateSpec)
orcreateCategory(String)
which offer an immutable approach to build specsRequests to create a category.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyCategoryCreateSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the createdCategory
. If an error is received, it is emitted through theMono
.
-
createCategory
Requests to create a category. Properties specifying how to create the category can be set via thewithXxx
methods of the returnedCategoryCreateMono
.- Parameters:
name
- the name of the category to create- Returns:
- A
CategoryCreateMono
where, upon successful completion, emits the createdCategory
. If an error is received, it is emitted through theCategoryCreateMono
.
-
createCategory
Requests to create a category. -
createTextChannel
@Deprecated public Mono<TextChannel> createTextChannel(Consumer<? super LegacyTextChannelCreateSpec> spec) Deprecated.usecreateTextChannel(TextChannelCreateSpec)
orcreateTextChannel(String)
which offer an immutable approach to build specsRequests to create a text channel.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyTextChannelCreateSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the createdTextChannel
. If an error is received, it is emitted through theMono
.
-
createTextChannel
Requests to create a text channel. Properties specifying how to create the text channel can be set via thewithXxx
methods of the returnedTextChannelCreateMono
.- Parameters:
name
- the name of the text channel to create- Returns:
- A
TextChannelCreateMono
where, upon successful completion, emits the createdTextChannel
. If an error is received, it is emitted through theTextChannelCreateMono
.
-
createTextChannel
Requests to create a text channel.- Parameters:
spec
- an immutable object that specifies how to create the text channel- Returns:
- A
Mono
where, upon successful completion, emits the createdTextChannel
. If an error is received, it is emitted through theMono
.
-
createVoiceChannel
@Deprecated public Mono<VoiceChannel> createVoiceChannel(Consumer<? super LegacyVoiceChannelCreateSpec> spec) Deprecated.usecreateVoiceChannel(VoiceChannelCreateSpec)
orcreateVoiceChannel(String)
which offer an immutable approach to build specsRequests to create a voice channel.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyVoiceChannelCreateSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits the createdVoiceChannel
. If an error is received, it is emitted through theMono
.
-
createVoiceChannel
Requests to create a voice channel. Properties specifying how to create the voice channel can be set via thewithXxx
methods of the returnedVoiceChannelCreateMono
.- Parameters:
name
- the name of the voice channel to create- Returns:
- A
VoiceChannelCreateMono
where, upon successful completion, emits the createdVoiceChannel
. If an error is received, it is emitted through theVoiceChannelCreateMono
.
-
createVoiceChannel
Requests to create a voice channel.- Parameters:
spec
- an immutable object that specifies how to create the voice channel- Returns:
- A
Mono
where, upon successful completion, emits the createdVoiceChannel
. If an error is received, it is emitted through theMono
.
-
createStageChannel
Requests to create a stage channel.- Parameters:
spec
- an immutable object that specifies how to create the stage channel- Returns:
- A
Mono
where, upon successful completion, emits the createdStageChannel
. If an error is received, it is emitted through theMono
.
-
createForumChannel
Requests to create a forum channel.- Parameters:
spec
- an immutable object that specifies how to create the forum channel- Returns:
- A
Mono
where, upon successful completion, emits the createdForumChannel
. If an error is received, it is emitted through theMono
.
-
createAutoModRule
public discord4j.core.spec.AutoModRuleCreateMono createAutoModRule(String name, AutoModRule.EventType eventType, AutoModRule.TriggerType triggerType) Requests to create an automod rule. Properties specifying how to create the rule can be set via thewithXxx
methods of the returnedAutoModRuleCreateMono
.- Parameters:
name
- new name to seteventType
- type of event to settriggerType
- type of trigger to set- Returns:
- A
AutoModRuleCreateMono
where, upon successful completion, emits the createdAutoModRule
. If an error is received, it is emitted through theAutoModRuleCreateMono
.
-
createAutoModRule
Requests to create an AutoMod Rule.- Parameters:
spec
- an immutable object that specifies how to create the emoji- Returns:
- A
Mono
where, upon successful completion, emits the createdAutoModRule
. If an error is received, it is emitted through theMono
.
-
delete
Requests to delete this guild.- Returns:
- A
Mono
where, upon successful completion, emits nothing; indicating the guild has been deleted. If an error is received, it is emitted through theMono
.
-
kick
Requests to kick the specified user from this guild.- Parameters:
userId
- The ID of the user to kick from this guild.- Returns:
- A
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 theMono
.
-
kick
Requests to kick the specified user from this guild while optionally specifying a reason.- Parameters:
userId
- The ID of the user to kick from this guild.reason
- The reason, if present.- Returns:
- A
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 theMono
.
-
getBans
Requests to retrieve all the bans for this guild. -
getBan
Requests to retrieve the ban for the specified user for this guild. -
ban
Deprecated.useban(Snowflake, BanQuerySpec)
orban(Snowflake)
which offer an immutable approach to build specsRequests to ban the specified user.- Parameters:
userId
- The ID of the user to ban.spec
- AConsumer
that provides a "blank"LegacyBanQuerySpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, emits nothing; indicating the specified user was banned. If an error is received, it is emitted through theMono
.
-
ban
Requests to ban the specified user. Properties specifying how to ban the user can be set via thewithXxx
methods of the returnedGuildBanQueryMono
.- Parameters:
userId
- The ID of the user to ban.- Returns:
- A
GuildBanQueryMono
where, upon successful completion, emits nothing; indicating the specified user was banned. If an error is received, it is emitted through theGuildBanQueryMono
.
-
ban
Requests to ban the specified user.- Parameters:
userId
- The ID of the user to ban.spec
- an immutable object that specifies how to ban the user- Returns:
- A
Mono
where, upon successful completion, emits nothing; indicating the specified user was banned. If an error is received, it is emitted through theMono
.
-
unban
Requests to unban the specified user.- Parameters:
userId
- The ID of the user to unban.- Returns:
- A
Mono
where, upon successful completion, emits nothing; indicating the specified user was unbanned. If an error is received, it is emitted through theMono
.
-
unban
Requests to unban the specified user while optionally specifying a reason.- Parameters:
userId
- The ID of the user to unban.reason
- The reason, if present.- Returns:
- A
Mono
where, upon successful completion, emits nothing; indicating the specified user was unbanned. If an error is received, it is emitted through theMono
.
-
getPruneCount
Deprecated.usegetPruneCount(GuildPruneCountSpec)
orgetPruneCount(int)
which offer an immutable approach to build specsRequests to retrieve the number of users that will be pruned. Users are pruned if they have not been seen within the past specified amount of days, with roles optionally included in the prune count if specified throughLegacyGuildPruneCountSpec.addRole(Snowflake)
orLegacyGuildPruneCountSpec.addRoles(Collection)
. -
getPruneCount
public discord4j.core.spec.GuildPruneCountMono getPruneCount(int days) Requests to retrieve the number of users that will be pruned. Users are pruned if they have not been seen within the past specified amount of days. Included roles can be set via theGuildPruneCountMono.withRoles(Snowflake...)
method of the returnedGuildPruneCountMono
.- Parameters:
days
- The number of days since an user must have been seen to avoid being kicked.- Returns:
- A
GuildPruneCountMono
where, upon successful completion, emits the number of users that will be pruned. If an error is received, it is emitted through theGuildPruneCountMono
.
-
getPruneCount
Requests to retrieve the number of users that will be pruned. Users are pruned if they have not been seen within the past specified amount of days, with roles optionally included in the prune count if specified throughGuildPruneCountSpec.roles()
.- Parameters:
spec
- an immutable object that specifies how to get prune count- Returns:
- A
Mono
where, upon successful completion, emits the number of users that will be pruned. If an error is received, it is emitted through theMono
.
-
prune
Deprecated.useprune(GuildPruneSpec)
orprune(int)
which offer an immutable approach to build specsRequests to prune users while customizing parameters. Users are pruned if they have not been seen within the past specified amount of days, with roles optionally included in the prune request if specified throughLegacyGuildPruneSpec.addRole(Snowflake)
orLegacyGuildPruneSpec.addRoles(Collection)
.- Parameters:
spec
- AConsumer
that provides a "blank"LegacyGuildPruneSpec
to be operated on.- Returns:
- A
Mono
where, upon successful completion, may emit the number of users who were pruned ifLegacyGuildPruneSpec.setComputePruneCount(boolean)
istrue
(default), otherwise it would emit an emptyMono
. If an error is received, it is emitted through theMono
.
-
prune
public discord4j.core.spec.GuildPruneMono prune(int days) Requests to prune users. Users are pruned if they have not been seen within the past specified amount of days. Included roles can be set via theGuildPruneMono.withRoles(Snowflake...)
method of the returnedGuildPruneMono
.- Parameters:
days
- The number of days since an user must have been seen to avoid being kicked.- Returns:
- A
Mono
where, upon successful completion, may emit the number of users who were pruned ifGuildPruneMono.withComputePruneCount(Boolean)
istrue
(default), otherwise it would emit an emptyMono
. If an error is received, it is emitted through theMono
.
-
prune
Requests to prune users while customizing parameters. Users are pruned if they have not been seen within the past specified amount of days, with roles optionally included in the prune request if specified throughGuildPruneSpec.roles()
.- Parameters:
spec
- an immutable object that specifies how to prune users of this guild- Returns:
- A
Mono
where, upon successful completion, may emit the number of users who were pruned ifGuildPruneSpec.computePruneCount()
istrue
(default), otherwise it would emit an emptyMono
. If an error is received, it is emitted through theMono
.
-
leave
Requests to leave this guild.- Returns:
- A
Mono
where, upon successful completion, emits nothing; indicating this guild has been left. If an error is received, it is emitted through theMono
.
-
getAuditLog
Deprecated.usegetAuditLog(AuditLogQuerySpec)
orgetAuditLog()
which offer an immutable approach to build specsRequests to retrieve the audit log for this guild.The audit log parts can be
combined
for easier querying. For example,guild.getAuditLog() .take(10) .reduce(AuditLogPart::combine)
- Parameters:
spec
- AConsumer
that provides a "blank"LegacyAuditLogQuerySpec
to be operated on.- Returns:
- A
Flux
that continually parts of this guild's audit log. If an error is received, it is emitted through theFlux
.
-
getAuditLog
public discord4j.core.spec.AuditLogQueryFlux getAuditLog()Requests to retrieve the audit log for this guild. Properties specifying how to query audit log can be set viawithXxx
methods of the returnedAuditLogQueryFlux
.The audit log parts can be
combined
for easier querying. For example,guild.getAuditLog() .take(10) .reduce(AuditLogPart::combine)
- Returns:
- A
AuditLogQueryFlux
that continually emits parts of this guild's audit log. If an error is received, it is emitted through theFlux
.
-
getAuditLog
Requests to retrieve the audit log for this guild.The audit log parts can be
combined
for easier querying. For example,guild.getAuditLog() .take(10) .reduce(AuditLogPart::combine)
- Parameters:
spec
- an immutable object that specifies how to query audit log- Returns:
- A
Flux
that continually emits parts of this guild's audit log. If an error is received, it is emitted through theFlux
.
-
getWebhooks
Requests to retrieve the webhooks of the guild. Requires the MANAGE_WEBHOOKS permission. -
getInvites
Requests to retrieve the invites of the guild. -
getTemplates
Requests to retrieve the templates of the guild. -
changeSelfNickname
Requests to change the bot user's nickname in this guild.- Parameters:
nickname
- The new nickname for the bot user in this guild, ornull
to remove it.- Returns:
- A
Mono
where, upon successful completion, emits the bot user's new nickname in this guild. If the nickname was set tonull
, then thisMono
will complete empty. If an error is received, it is emitted through theMono
.
-
getVoiceConnection
Returns the current voice connection registered for this guild.- Returns:
- A
Mono
ofVoiceConnection
for this guild if present, or empty otherwise.
-
getActiveThreads
Requests to retrieve the active threads of the guild.The audit log parts can be
combined
for easier querying. For example,guild.getActiveThreads() .take(10) .reduce(ThreadListPart::combine)
-
getAutoModRules
Requests to retrieve the automod rules of the guild. Requires the MANAGE_GUILD permission.- Returns:
- A
Flux
that continually emits theautomod rules
of the guild. If an error is received, it is emitted through theFlux
.
-
getAutoModRule
Requests to retrieve the automod rule of the guild using the ID. Requires the MANAGE_GUILD permission.- Returns:
- A
Mono
ofAutoModRule
for this guild if present, or empty otherwise.
-
getScheduledEventById
Requests to retrieve the scheduled event using the provided ID.- Parameters:
eventId
- the event IDwithUserCount
- Requests to fetch the enrolled user count to Discord or not- Returns:
- A
Mono
which, upon completion, emits an associatedScheduledEvent
if found.
-
getScheduledEvents
Requests to retrieve all the scheduled events associated to this guild.- Parameters:
withUserCount
- Requests to fetch the enrolled user count to Discord or not- Returns:
- A
Flux
which emitsScheduledEvent
objects.
-
createScheduledEvent
Requests to create a guild scheduled event with the provided spec on this guild- Parameters:
spec
- spec specifyingScheduledEvent
parameters- Returns:
- A
Mono
which, upon completion, emits the createdScheduledEvent
object. Any error, if occurs, is emitted through theMono
.
-
equals
-
hashCode
public int hashCode() -
toString
-
ban(Snowflake, BanQuerySpec)
orban(Snowflake)
which offer an immutable approach to build specs