Package net.dv8tion.jda.core.managers
Class GuildManager
- java.lang.Object
-
- net.dv8tion.jda.core.requests.RestAction<T>
-
- net.dv8tion.jda.core.requests.restaction.AuditableRestAction<java.lang.Void>
-
- net.dv8tion.jda.core.managers.impl.ManagerBase
-
- net.dv8tion.jda.core.managers.GuildManager
-
public class GuildManager extends net.dv8tion.jda.core.managers.impl.ManagerBase
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()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.dv8tion.jda.core.requests.restaction.AuditableRestAction
AuditableRestAction.EmptyRestAction<T>
-
-
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
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
VERIFICATION_LEVEL
Used to reset the verification level field-
Fields inherited from class net.dv8tion.jda.core.requests.RestAction
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
-
-
Constructor Summary
Constructors Constructor Description GuildManager(Guild guild)
-
Method Summary
-
Methods inherited from class net.dv8tion.jda.core.managers.impl.ManagerBase
complete, isPermissionChecksEnabled, queue, setPermissionChecksEnabled
-
Methods inherited from class net.dv8tion.jda.core.requests.restaction.AuditableRestAction
reason, setCheck
-
Methods inherited from class net.dv8tion.jda.core.requests.RestAction
complete, completeAfter, getJDA, isPassContext, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
-
-
-
-
Field Detail
-
NAME
public static final long NAME
Used to reset the name field- See Also:
- Constant Field Values
-
REGION
public static final long REGION
Used to reset the region field- See Also:
- Constant Field Values
-
ICON
public static final long ICON
Used to reset the icon field- See Also:
- Constant Field Values
-
SPLASH
public static final long SPLASH
Used to reset the splash field- See Also:
- Constant Field Values
-
AFK_CHANNEL
public static final long AFK_CHANNEL
Used to reset the afk channel field- See Also:
- Constant Field Values
-
AFK_TIMEOUT
public static final long AFK_TIMEOUT
Used to reset the afk timeout field- See Also:
- Constant Field Values
-
SYSTEM_CHANNEL
public static final long SYSTEM_CHANNEL
Used to reset the system channel field- See Also:
- Constant Field Values
-
MFA_LEVEL
public static final long MFA_LEVEL
Used to reset the mfa level field- See Also:
- Constant Field Values
-
NOTIFICATION_LEVEL
public static final long NOTIFICATION_LEVEL
Used to reset the default notification level field- See Also:
- Constant Field Values
-
EXPLICIT_CONTENT_LEVEL
public static final long EXPLICIT_CONTENT_LEVEL
Used to reset the explicit content level field- See Also:
- Constant Field Values
-
VERIFICATION_LEVEL
public static final long VERIFICATION_LEVEL
Used to reset the verification level field- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GuildManager
public GuildManager(Guild guild)
-
-
Method Detail
-
getGuild
public Guild getGuild()
TheGuild
object of this Manager. Useful if this Manager was returned via a create function- Returns:
- The
Guild
of this Manager
-
reset
@CheckReturnValue public 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:
- Overrides:
reset
in classnet.dv8tion.jda.core.managers.impl.ManagerBase
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- GuildManager for chaining convenience
-
reset
@CheckReturnValue public 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:
- Overrides:
reset
in classnet.dv8tion.jda.core.managers.impl.ManagerBase
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- GuildManager for chaining convenience
-
reset
@CheckReturnValue public GuildManager reset()
Resets all fields for this manager.- Returns:
- GuildManager for chaining convenience
-
setName
@CheckReturnValue public GuildManager setName(java.lang.String name)
Sets the name of thisGuild
.- Parameters:
name
- The new name for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided name isnull
or not between 2-100 characters long
-
setRegion
@CheckReturnValue public GuildManager setRegion(Region region)
- Parameters:
region
- The new region for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.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
@CheckReturnValue public GuildManager setIcon(Icon icon)
- Parameters:
icon
- The new icon for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
-
setSplash
@CheckReturnValue public GuildManager setSplash(Icon splash)
-
setAfkChannel
@CheckReturnValue public GuildManager setAfkChannel(VoiceChannel afkChannel)
Sets the AFKVoiceChannel
of thisGuild
.- Parameters:
afkChannel
- The new afk channel for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided channel is not from this guild
-
setSystemChannel
@CheckReturnValue public GuildManager setSystemChannel(TextChannel systemChannel)
Sets the systemTextChannel
of thisGuild
.- Parameters:
systemChannel
- The new system channel for thisGuild
ornull
to reset- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided channel is not from this guild
-
setAfkTimeout
@CheckReturnValue public GuildManager setAfkTimeout(Guild.Timeout timeout)
- Parameters:
timeout
- The new afk timeout for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided timeout isnull
-
setVerificationLevel
@CheckReturnValue public GuildManager setVerificationLevel(Guild.VerificationLevel level)
Sets theVerification Level
of thisGuild
.- Parameters:
level
- The new Verification Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
setDefaultNotificationLevel
@CheckReturnValue public GuildManager setDefaultNotificationLevel(Guild.NotificationLevel level)
Sets theNotification Level
of thisGuild
.- Parameters:
level
- The new Notification Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
setRequiredMFALevel
@CheckReturnValue public GuildManager setRequiredMFALevel(Guild.MFALevel level)
- Parameters:
level
- The new MFA Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
setExplicitContentLevel
@CheckReturnValue public GuildManager setExplicitContentLevel(Guild.ExplicitContentLevel level)
Sets theExplicit Content Level
of thisGuild
.- Parameters:
level
- The new MFA Level for thisGuild
- Returns:
- GuildManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided level isnull
or UNKNOWN
-
-