Package net.dv8tion.jda.api.managers
Interface GuildManager
-
- All Superinterfaces:
AuditableRestAction<Void>
,Manager<GuildManager>
,RestAction<Void>
public interface GuildManager extends Manager<GuildManager>
Manager providing functionality to update one or more fields for aGuild
.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:
Guild.getManager()
-
-
Field Summary
Fields Modifier and Type Field Description static long
AFK_CHANNEL
Used to reset the afk channel fieldstatic long
AFK_TIMEOUT
Used to reset the afk timeout fieldstatic long
BANNER
Used to reset the banner fieldstatic long
DESCRIPTION
Used to reset the description fieldstatic long
EXPLICIT_CONTENT_LEVEL
Used to reset the explicit content level fieldstatic long
ICON
Used to reset the icon fieldstatic long
MFA_LEVEL
Used to reset the mfa level fieldstatic long
NAME
Used to reset the name fieldstatic long
NOTIFICATION_LEVEL
Used to reset the default notification level fieldstatic long
REGION
Used to reset the region fieldstatic long
SPLASH
Used to reset the splash fieldstatic long
SYSTEM_CHANNEL
Used to reset the system channel fieldstatic long
VANITY_URL
Used to reset the vanity code fieldstatic long
VERIFICATION_LEVEL
Used to reset the verification level field
-
Method Summary
-
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
-
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
complete, complete, completeAfter, getJDA, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter
-
-
-
-
Field Detail
-
NAME
static final long NAME
Used to reset the name field- See Also:
- Constant Field Values
-
REGION
static final long REGION
Used to reset the region field- See Also:
- Constant Field Values
-
ICON
static final long ICON
Used to reset the icon field- See Also:
- Constant Field Values
-
SPLASH
static final long SPLASH
Used to reset the splash field- See Also:
- Constant Field Values
-
AFK_CHANNEL
static final long AFK_CHANNEL
Used to reset the afk channel field- See Also:
- Constant Field Values
-
AFK_TIMEOUT
static final long AFK_TIMEOUT
Used to reset the afk timeout field- See Also:
- Constant Field Values
-
SYSTEM_CHANNEL
static final long SYSTEM_CHANNEL
Used to reset the system channel field- See Also:
- Constant Field Values
-
MFA_LEVEL
static final long MFA_LEVEL
Used to reset the mfa level field- See Also:
- Constant Field Values
-
NOTIFICATION_LEVEL
static final long NOTIFICATION_LEVEL
Used to reset the default notification level field- See Also:
- Constant Field Values
-
EXPLICIT_CONTENT_LEVEL
static final long EXPLICIT_CONTENT_LEVEL
Used to reset the explicit content level field- See Also:
- Constant Field Values
-
VERIFICATION_LEVEL
static final long VERIFICATION_LEVEL
Used to reset the verification level field- See Also:
- Constant Field Values
-
BANNER
static final long BANNER
Used to reset the banner field- See Also:
- Constant Field Values
-
VANITY_URL
static final long VANITY_URL
Used to reset the vanity code field- See Also:
- Constant Field Values
-
DESCRIPTION
static final long DESCRIPTION
Used to reset the description field- See Also:
- Constant Field Values
-
-
Method Detail
-
reset
@Nonnull GuildManager reset(long fields)
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
@Nonnull GuildManager reset(long... fields)
Resets the fields specified by the provided bit-flag patterns. 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 values containing the flags to reset.- Returns:
- GuildManager for chaining convenience
-
getGuild
@Nonnull Guild getGuild()
TheGuild
object of this Manager. Useful if this Manager was returned via a create function- Returns:
- The
Guild
of this Manager
-
setName
@Nonnull @CheckReturnValue GuildManager setName(@Nonnull String name)
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
-
setRegion
@Nonnull @CheckReturnValue GuildManager setRegion(@Nonnull Region region)
- Parameters:
region
- The new region for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided region is aVIP Region
but the guild does not support VIP regions. UseGuild#getFeatures()
to check if VIP regions are supported.- See Also:
Region.isVip()
,Guild.getFeatures()
-
setIcon
@Nonnull @CheckReturnValue GuildManager setIcon(@Nullable Icon icon)
- Parameters:
icon
- The new icon for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
-
setSplash
@Nonnull @CheckReturnValue GuildManager setSplash(@Nullable Icon splash)
- Parameters:
splash
- The new splash for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException
- If the guild'sfeatures
does not includeINVITE_SPLASH
-
setAfkChannel
@Nonnull @CheckReturnValue GuildManager setAfkChannel(@Nullable VoiceChannel afkChannel)
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
@Nonnull @CheckReturnValue GuildManager setSystemChannel(@Nullable TextChannel systemChannel)
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
-
setAfkTimeout
@Nonnull @CheckReturnValue GuildManager setAfkTimeout(@Nonnull Guild.Timeout timeout)
- 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
@Nonnull @CheckReturnValue GuildManager setRequiredMFALevel(@Nonnull Guild.MFALevel level)
- 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
@Nonnull @CheckReturnValue GuildManager setBanner(@Nullable Icon banner)
- Parameters:
banner
- The new banner for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException
- If the guild'sfeatures
does not includeBANNER
-
setVanityCode
@Nonnull @CheckReturnValue GuildManager setVanityCode(@Nullable String code)
- Parameters:
code
- The new vanity code for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException
- If the guild'sfeatures
does not includeVANITY_URL
-
setDescription
@Nonnull @CheckReturnValue GuildManager setDescription(@Nullable String description)
- Parameters:
description
- The new description for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
IllegalStateException
- If the guild'sfeatures
does not includeVERIFIED
-
-