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
Modifier and TypeFieldDescriptionstatic final long
Used to reset the afk channel fieldstatic final long
Used to reset the afk timeout fieldstatic final long
Used to reset the banner fieldstatic final long
Used to reset the premium progress bar enabled fieldstatic final long
Used to reset the community updates channel fieldstatic final long
Used to reset the description fieldstatic final long
Used to reset the explicit content level fieldstatic final long
Used to add or remove modifiable features (such as"INVITES_DISABLED"
)static final long
Used to reset the icon fieldstatic final long
Used to reset the mfa level fieldstatic final long
Used to reset the name fieldstatic final long
Used to reset the default notification level fieldstatic final long
Used to reset the rules channel fieldstatic final long
Used to rest the safety alerts channel fieldstatic final long
Used to reset the splash fieldstatic final long
Used to reset the system channel fieldstatic final long
Used to reset the verification level fieldFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptiondefault GuildManager
addFeatures
(String... features) Adds aGuild Feature
to the list of features.addFeatures
(Collection<String> features) Adds aGuild Feature
to the list of features.getGuild()
TheGuild
object of this Manager.default GuildManager
removeFeatures
(String... features) Removes aGuild Feature
from the list of features.removeFeatures
(Collection<String> features) Removes aGuild Feature
from 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 AFKVoiceChannel
of thisGuild
.setAfkTimeout
(Guild.Timeout timeout) setBoostProgressBarEnabled
(boolean boostProgressBarEnabled) Sets whether thisGuild
should have its boost progress bar shown.setCommunityUpdatesChannel
(TextChannel communityUpdatesChannel) Sets the community updatesTextChannel
of thisGuild
.Sets theNotification Level
of thisGuild
.setDescription
(String description) Sets theExplicit Content Level
of thisGuild
.setFeatures
(Collection<String> features) default GuildManager
setInvitesDisabled
(boolean disabled) Configures theINVITES_DISABLED
feature flag of this guild.Sets the name of thisGuild
.setRulesChannel
(TextChannel rulesChannel) Sets the rulesTextChannel
of thisGuild
.setSafetyAlertsChannel
(TextChannel safetyAlertsChannel) Sets the safety alertsTextChannel
of thisGuild
.setSystemChannel
(TextChannel systemChannel) Sets the systemTextChannel
of thisGuild
.Sets theVerification Level
of thisGuild
.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
Methods 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:
reset
in 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:
reset
in interfaceManager<GuildManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- GuildManager for chaining convenience
-
getGuild
TheGuild
object of this Manager. Useful if this Manager was returned via a create function- Returns:
- The
Guild
of 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 isnull
or not between 2-100 characters long
-
setIcon
- Parameters:
icon
- The new icon for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
-
setSplash
- Parameters:
splash
- The new splash for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException
- If the guild'sfeatures
do not includeINVITE_SPLASH
-
setAfkChannel
Sets the AFKVoiceChannel
of thisGuild
.- Parameters:
afkChannel
- The new afk channel for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided channel is not from this guild
-
setSystemChannel
Sets the systemTextChannel
of thisGuild
.- Parameters:
systemChannel
- The new system channel for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided channel is not from this guild
-
setRulesChannel
Sets the rulesTextChannel
of thisGuild
.- Parameters:
rulesChannel
- The new rules channel for thisGuild
ornull
to 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 updatesTextChannel
of thisGuild
.- Parameters:
communityUpdatesChannel
- The new community updates channel for thisGuild
ornull
to 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 alertsTextChannel
of thisGuild
.- Parameters:
safetyAlertsChannel
- The new safety alerts channel for thisGuild
ornull
to 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 Level
of thisGuild
.- Parameters:
level
- The new Verification Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
setDefaultNotificationLevel
@Nonnull @CheckReturnValue GuildManager setDefaultNotificationLevel(@Nonnull Guild.NotificationLevel level) Sets theNotification Level
of thisGuild
.- Parameters:
level
- The new Notification Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
setRequiredMFALevel
- Parameters:
level
- The new MFA Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
setExplicitContentLevel
@Nonnull @CheckReturnValue GuildManager setExplicitContentLevel(@Nonnull Guild.ExplicitContentLevel level) Sets theExplicit Content Level
of thisGuild
.- Parameters:
level
- The new MFA Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
setBanner
- Parameters:
banner
- The new banner for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException
- If the guild'sfeatures
do not includeBANNER
-
setDescription
- Parameters:
description
- The new description for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException
- If the guild'sfeatures
do not includeVERIFIED
-
setBoostProgressBarEnabled
Sets whether thisGuild
should 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 newfeatures
of 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 Feature
to 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 Feature
to 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 Feature
from 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 Feature
from 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_DISABLED
feature flag of this guild.
This is equivalent to adding or removing the featureINVITES_DISABLED
viasetFeatures(Collection)
.- Parameters:
disabled
- True, to pause/disable all invites to the guild- Returns:
- GuildManager for chaining convenience
-