Package net.dv8tion.jda.api.managers
Interface GuildManager
- All Superinterfaces:
AuditableRestAction<Void>,Manager<GuildManager>,RestAction<Void>
Manager providing functionality to update one or more fields for a
Guild.
Example
manager.setName("Official JDA Guild")
.setIcon(null)
.queue();
manager.reset(GuildManager.NAME | GuildManager.ICON)
.setName("Minn's Meme Den")
.setExplicitContentLevel(Guild.ExplicitContentLevel.HIGH)
.queue();
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longUsed to reset the afk channel fieldstatic final longUsed to reset the afk timeout fieldstatic final longUsed to reset the banner fieldstatic final longUsed to reset the premium progress bar enabled fieldstatic final longUsed to reset the community updates channel fieldstatic final longUsed to reset the description fieldstatic final longUsed to reset the explicit content level fieldstatic final longUsed to add or remove modifiable features (such as"INVITES_DISABLED")static final longUsed to reset the icon fieldstatic final longUsed to reset the mfa level fieldstatic final longUsed to reset the name fieldstatic final longUsed to reset the default notification level fieldstatic final longUsed to reset the rules channel fieldstatic final longUsed to rest the safety alerts channel fieldstatic final longUsed to reset the splash fieldstatic final longUsed to reset the system channel fieldstatic final longUsed to reset the verification level fieldFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH -
Method Summary
Modifier and TypeMethodDescriptiondefault GuildManageraddFeatures(String... features) Adds aGuild Featureto the list of features.addFeatures(Collection<String> features) Adds aGuild Featureto the list of features.getGuild()TheGuildobject of this Manager.default GuildManagerremoveFeatures(String... features) Removes aGuild Featurefrom the list of features.removeFeatures(Collection<String> features) Removes aGuild Featurefrom the list of features.reset(long fields) Resets the fields specified by the provided bit-flag pattern.reset(long... fields) Resets the fields specified by the provided bit-flag patterns.setAfkChannel(VoiceChannel afkChannel) Sets the AFKVoiceChannelof thisGuild.setAfkTimeout(Guild.Timeout timeout) setBoostProgressBarEnabled(boolean boostProgressBarEnabled) Sets whether thisGuildshould have its boost progress bar shown.setCommunityUpdatesChannel(TextChannel communityUpdatesChannel) Sets the community updatesTextChannelof thisGuild.Sets theNotification Levelof thisGuild.setDescription(String description) Sets theExplicit Content Levelof thisGuild.setFeatures(Collection<String> features) default GuildManagersetInvitesDisabled(boolean disabled) Configures theINVITES_DISABLEDfeature flag of this guild.Sets the name of thisGuild.setRulesChannel(TextChannel rulesChannel) Sets the rulesTextChannelof thisGuild.setSafetyAlertsChannel(TextChannel safetyAlertsChannel) Sets the safety alertsTextChannelof thisGuild.setSystemChannel(TextChannel systemChannel) Sets the systemTextChannelof thisGuild.Sets theVerification Levelof thisGuild.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reasonMethods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeoutMethods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Field Details
-
NAME
static final long NAMEUsed to reset the name field- See Also:
-
ICON
static final long ICONUsed to reset the icon field- See Also:
-
SPLASH
static final long SPLASHUsed to reset the splash field- See Also:
-
AFK_CHANNEL
static final long AFK_CHANNELUsed to reset the afk channel field- See Also:
-
AFK_TIMEOUT
static final long AFK_TIMEOUTUsed to reset the afk timeout field- See Also:
-
SYSTEM_CHANNEL
static final long SYSTEM_CHANNELUsed to reset the system channel field- See Also:
-
MFA_LEVEL
static final long MFA_LEVELUsed to reset the mfa level field- See Also:
-
NOTIFICATION_LEVEL
static final long NOTIFICATION_LEVELUsed to reset the default notification level field- See Also:
-
EXPLICIT_CONTENT_LEVEL
static final long EXPLICIT_CONTENT_LEVELUsed to reset the explicit content level field- See Also:
-
VERIFICATION_LEVEL
static final long VERIFICATION_LEVELUsed to reset the verification level field- See Also:
-
BANNER
static final long BANNERUsed to reset the banner field- See Also:
-
DESCRIPTION
static final long DESCRIPTIONUsed to reset the description field- See Also:
-
RULES_CHANNEL
static final long RULES_CHANNELUsed to reset the rules channel field- See Also:
-
COMMUNITY_UPDATES_CHANNEL
static final long COMMUNITY_UPDATES_CHANNELUsed to reset the community updates channel field- See Also:
-
BOOST_PROGRESS_BAR_ENABLED
static final long BOOST_PROGRESS_BAR_ENABLEDUsed to reset the premium progress bar enabled field- See Also:
-
FEATURES
static final long FEATURESUsed to add or remove modifiable features (such as"INVITES_DISABLED")- See Also:
-
SAFETY_ALERTS_CHANNEL
static final long SAFETY_ALERTS_CHANNELUsed to rest the safety alerts channel field- See Also:
-
-
Method Details
-
reset
Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
Example:manager.reset(GuildManager.NAME | GuildManager.ICON);Flag Constants:
- Specified by:
resetin interfaceManager<GuildManager>- Parameters:
fields- Integer value containing the flags to reset.- Returns:
- GuildManager for chaining convenience
-
reset
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(GuildManager.NAME, GuildManager.ICON);Flag Constants:
- Specified by:
resetin interfaceManager<GuildManager>- Parameters:
fields- Integer values containing the flags to reset.- Returns:
- GuildManager for chaining convenience
-
getGuild
TheGuildobject of this Manager. Useful if this Manager was returned via a create function- Returns:
- The
Guildof this Manager
-
setName
Sets the name of thisGuild.- Parameters:
name- The new name for thisGuild- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided name isnullor not between 2-100 characters long
-
setIcon
- Parameters:
icon- The new icon for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
-
setSplash
- Parameters:
splash- The new splash for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException- If the guild'sfeaturesdo not includeINVITE_SPLASH
-
setAfkChannel
Sets the AFKVoiceChannelof thisGuild.- Parameters:
afkChannel- The new afk channel for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided channel is not from this guild
-
setSystemChannel
Sets the systemTextChannelof thisGuild.- Parameters:
systemChannel- The new system channel for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided channel is not from this guild
-
setRulesChannel
Sets the rulesTextChannelof thisGuild.- Parameters:
rulesChannel- The new rules channel for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided channel is not from this guild
-
setCommunityUpdatesChannel
@Nonnull @CheckReturnValue GuildManager setCommunityUpdatesChannel(@Nullable TextChannel communityUpdatesChannel) Sets the community updatesTextChannelof thisGuild.- Parameters:
communityUpdatesChannel- The new community updates channel for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided channel is not from this guild
-
setSafetyAlertsChannel
@Nonnull @CheckReturnValue GuildManager setSafetyAlertsChannel(@Nullable TextChannel safetyAlertsChannel) Sets the safety alertsTextChannelof thisGuild.- Parameters:
safetyAlertsChannel- The new safety alerts channel for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided channel is not from this guild
-
setAfkTimeout
- Parameters:
timeout- The new afk timeout for thisGuild- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided timeout isnull
-
setVerificationLevel
@Nonnull @CheckReturnValue GuildManager setVerificationLevel(@Nonnull Guild.VerificationLevel level) Sets theVerification Levelof thisGuild.- Parameters:
level- The new Verification Level for thisGuild- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided level isnullor UNKNOWN
-
setDefaultNotificationLevel
@Nonnull @CheckReturnValue GuildManager setDefaultNotificationLevel(@Nonnull Guild.NotificationLevel level) Sets theNotification Levelof thisGuild.- Parameters:
level- The new Notification Level for thisGuild- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided level isnullor UNKNOWN
-
setRequiredMFALevel
- Parameters:
level- The new MFA Level for thisGuild- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided level isnullor UNKNOWN
-
setExplicitContentLevel
@Nonnull @CheckReturnValue GuildManager setExplicitContentLevel(@Nonnull Guild.ExplicitContentLevel level) Sets theExplicit Content Levelof thisGuild.- Parameters:
level- The new MFA Level for thisGuild- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided level isnullor UNKNOWN
-
setBanner
- Parameters:
banner- The new banner for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException- If the guild'sfeaturesdo not includeBANNER
-
setDescription
- Parameters:
description- The new description for thisGuildornullto reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException- If the guild'sfeaturesdo not includeVERIFIED
-
setBoostProgressBarEnabled
Sets whether thisGuildshould have its boost progress bar shown.- Parameters:
boostProgressBarEnabled- Whether the boost progress bar should be shown for thisGuild- Returns:
- GuildManager for chaining convenience
-
setFeatures
Configures the newfeaturesof theGuild.
The list of available features, including which ones can be configured, is available in the Official Discord API Documentation.Example
List<String> features = new ArrayList<>(guild.getFeatures()); features.add("INVITES_DISABLED"); guild.getManager().setFeatures(features).queue();- Parameters:
features- The new features to use- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided list is null
-
addFeatures
Adds aGuild Featureto the list of features.
The list of available features, including which ones can be configured, is available in the Official Discord API Documentation.- Parameters:
features- The features to add- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If any of the provided features is null
-
addFeatures
Adds aGuild Featureto the list of features.
The list of available features, including which ones can be configured, is available in the Official Discord API Documentation.- Parameters:
features- The features to add- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If any of the provided features is null
-
removeFeatures
Removes aGuild Featurefrom the list of features.
The list of available features, including which ones can be configured, is available in the Official Discord API Documentation.- Parameters:
features- The features to remove- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If any of the provided features is null
-
removeFeatures
Removes aGuild Featurefrom the list of features.
The list of available features, including which ones can be configured, is available in the Official Discord API Documentation.- Parameters:
features- The features to remove- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException- If any of the provided features is null
-
setInvitesDisabled
Configures theINVITES_DISABLEDfeature flag of this guild.
This is equivalent to adding or removing the featureINVITES_DISABLEDviasetFeatures(Collection).- Parameters:
disabled- True, to pause/disable all invites to the guild- Returns:
- GuildManager for chaining convenience
-