public class GuildManagerUpdatable
extends java.lang.Object
updatable manager that allows
to modify guild settings like the name or the splash.
This manager allows to modify multiple fields at once
by getting the GuildField for specific
properties and setting or resetting their values; followed by a call of update()!
The GuildManager implementation
simplifies this process by giving simple setters that return the update RestAction
Note: To update this manager
the currently logged in account requires the Permission MANAGE_SERVER
To use moderation abilities like creating Roles or banning Members use GuildController
| Constructor and Description |
|---|
GuildManagerUpdatable(Guild guild)
Creates a new GuildManagerUpdatable instance
|
| Modifier and Type | Method and Description |
|---|---|
GuildField<VoiceChannel> |
getAfkChannelField()
|
GuildField<Guild.Timeout> |
getAfkTimeoutField()
|
GuildField<Guild.NotificationLevel> |
getDefaultNotificationLevelField()
|
GuildField<Guild.ExplicitContentLevel> |
getExplicitContentLevelField()
|
Guild |
getGuild()
The
Guild object of this Manager. |
GuildField<Icon> |
getIconField()
|
JDA |
getJDA()
The
JDA instance of this Manager |
GuildField<java.lang.String> |
getNameField()
An
GuildField
for the name of the selected Guild. |
GuildField<Region> |
getRegionField()
|
GuildField<Guild.MFALevel> |
getRequiredMFALevelField()
|
GuildField<Icon> |
getSplashField()
|
GuildField<Guild.VerificationLevel> |
getVerificationLevelField()
|
void |
reset()
Resets all queued updates.
|
AuditableRestAction<java.lang.Void> |
update()
Creates a new
RestAction instance
that will apply all changes that have been made to this manager instance. |
public Guild getGuild()
Guild object of this Manager.
Useful if this Manager was returned via a create functionGuild of this Managerpublic GuildField<java.lang.String> getNameField()
GuildField
for the name of the selected Guild.
To set the value use setValue(String)
on the returned GuildField instance.
A guild name must not be null nor less than 2 characters or more than 100 characters long!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: StringGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Region> getRegionField()
GuildField
for the Region of the selected Guild.
To set the value use setValue(Region)
on the returned GuildField instance.
A guild region must not be null nor Region.UNKNOWN!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: RegionGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Icon> getIconField()
GuildField
for the Icon of the selected Guild.
null to setValue(Icon).
To set the value use setValue(Icon)
on the returned GuildField instance.
GuildField - Type: IconGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Icon> getSplashField()
GuildField
for the splash Icon of the selected Guild.
null to setValue(Icon).
To set the value use setValue(Icon)
on the returned GuildField instance.
GuildField - Type: IconGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<VoiceChannel> getAfkChannelField()
GuildField
for the AFK VoiceChannel of the selected Guild.
null to setValue(VoiceChannel).
To set the value use setValue(VoiceChannel)
on the returned GuildField instance.
A guild afk channel must be from this Guild!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: VoiceChannelGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Guild.Timeout> getAfkTimeoutField()
GuildField
for the AFK Timeout of the selected Guild.
300 (5 minutes)
To set the value use setValue(Guild.Timeout)
on the returned GuildField instance.
A guild afk timeout must not be null!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: Guild.TimeoutGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Guild.VerificationLevel> getVerificationLevelField()
GuildField
for the Verification Level of the selected Guild.
NONE
To set the value use setValue(Guild.VerificationLevel)
on the returned GuildField instance.
A guild verification level must not be null or UNKNOWN!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: Guild.VerificationLevelGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Guild.NotificationLevel> getDefaultNotificationLevelField()
GuildField
for the Notification Level of the selected Guild.
ALL_MESSAGES
To set the value use setValue(Guild.NotificationLevel)
on the returned GuildField instance.
A guild notification level must not be null or UNKNOWN!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: Guild.NotificationLevelGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Guild.MFALevel> getRequiredMFALevelField()
GuildField
for the MFA Level of the selected Guild.
NONE
To set the value use setValue(Guild.MFALevel)
on the returned GuildField instance.
A guild mfa level must not be null or UNKNOWN!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: Guild.MFALevelGuildUnavailableException - If the Guild is temporarily not availablepublic GuildField<Guild.ExplicitContentLevel> getExplicitContentLevelField()
GuildField
for the Explicit Content Level of the selected Guild.
OFF
To set the value use setValue(Guild.ExplicitContentLevel)
on the returned GuildField instance.
A guild explicit content level must not be null or UNKNOWN!
Otherwise Field.setValue(...) will
throw an IllegalArgumentException.
GuildField - Type: Guild.ExplicitContentLevelGuildUnavailableException - If the Guild is temporarily not availablepublic void reset()
@CheckReturnValue public AuditableRestAction<java.lang.Void> update()
RestAction instance
that will apply all changes that have been made to this manager instance.
EmptyRestAction.
Before applying new changes it is recommended to call reset() to reset previous changes.
This is automatically called if this method returns successfully.
Possible ErrorResponses for this
update include the following:
UNKNOWN_GUILD
MISSING_PERMISSIONS
MANAGE_SERVER Permission
before finishing the taskAuditableRestAction
InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_SERVER
in the underlying GuildGuildUnavailableException - If the Guild is temporarily not available