public class GuildManagerUpdatable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected VoiceChannel |
afkChannel |
protected boolean |
afkChannelSet |
protected Guild.NotificationLevel |
defaultNotificationLevel |
protected Guild |
guild |
protected Guild.MFALevel |
mfaLevel |
protected java.lang.String |
name |
protected Region |
region |
protected GuildManager.Timeout |
timeout |
protected Guild.VerificationLevel |
verificationLevel |
Constructor and Description |
---|
GuildManagerUpdatable(Guild guild)
Creates a
GuildManagerUpdatable that can be used to manage
different aspects of the provided Guild . |
Modifier and Type | Method and Description |
---|---|
protected void |
checkAvailable() |
protected void |
checkNull(java.lang.Object obj,
java.lang.String name) |
protected void |
checkPermission(Permission perm) |
Guild |
getGuild()
Returns the
Guild object of this Manager. |
protected boolean |
needToUpdate() |
void |
reset()
Resets all queued updates.
|
GuildManagerUpdatable |
setAfkChannel(VoiceChannel channel)
Changes the AFK
VoiceChannel of this Guild
If passed null, this will disable the AFK-Channel. |
GuildManagerUpdatable |
setAfkTimeout(GuildManager.Timeout timeout)
Changes the AFK Timeout of this Guild
After given timeout (in seconds) Users being AFK in voice are being moved to the AFK-Channel
Valid timeouts are: 60, 300, 900, 1800, 3600.
|
GuildManagerUpdatable |
setDefaultNotificationLevel(Guild.NotificationLevel level) |
GuildManagerUpdatable |
setName(java.lang.String name)
Changes the name of this Guild.
|
GuildManagerUpdatable |
setRegion(Region region)
|
GuildManagerUpdatable |
setRequiredMFALevel(Guild.MFALevel level) |
GuildManagerUpdatable |
setVerificationLevel(Guild.VerificationLevel level)
Changes the Verification-Level of this Guild.
|
RestAction<java.lang.Void> |
update()
This method will apply all accumulated changes received by setters
|
protected final Guild guild
protected GuildManager.Timeout timeout
protected java.lang.String name
protected Region region
protected boolean afkChannelSet
protected VoiceChannel afkChannel
protected Guild.VerificationLevel verificationLevel
protected Guild.NotificationLevel defaultNotificationLevel
protected Guild.MFALevel mfaLevel
public GuildManagerUpdatable(Guild guild)
GuildManagerUpdatable
that can be used to manage
different aspects of the provided Guild
.guild
- The Guild
which the manager deals with.GuildUnavailableException
- if the guild is temporarily unavailablepublic Guild getGuild()
Guild
object of this Manager. Useful if this Manager was returned via a create functionGuild
of this Managerpublic GuildManagerUpdatable setName(java.lang.String name)
update()
is called.
So multiple changes can be made at once.name
- the new name of the Guild, or null to keep current oneGuildManager
instance. Useful for chaining.GuildUnavailableException
- if the guild is temporarily unavailablepublic GuildManagerUpdatable setRegion(Region region)
Region
of this Guild
.
This change will only be applied, if update()
is called.
So multiple changes can be made at once.region
- the new Region
, or null to keep current oneGuildManager
instance. Useful for chaining.GuildUnavailableException
- if the guild is temporarily unavailablepublic GuildManagerUpdatable setAfkChannel(VoiceChannel channel)
VoiceChannel
of this Guild
If passed null, this will disable the AFK-Channel.
This change will only be applied, if update()
is called.
So multiple changes can be made at once.channel
- the new afk-channelGuildManager
instance. Useful for chaining.GuildUnavailableException
- if the guild is temporarily unavailablepublic GuildManagerUpdatable setAfkTimeout(GuildManager.Timeout timeout)
update()
is called.
So multiple changes can be made at once.timeout
- the new afk timeout, or null to keep current oneGuildManager
instance. Useful for chaining.GuildUnavailableException
- if the guild is temporarily unavailablepublic GuildManagerUpdatable setVerificationLevel(Guild.VerificationLevel level)
update()
is called.
So multiple changes can be made at once.level
- the new Verification-Level of the Guild, or null to keep current oneGuildManager
instance. Useful for chaining.GuildUnavailableException
- if the guild is temporarily unavailablepublic GuildManagerUpdatable setDefaultNotificationLevel(Guild.NotificationLevel level)
public GuildManagerUpdatable setRequiredMFALevel(Guild.MFALevel level)
public void reset()
update()
will change nothing.public RestAction<java.lang.Void> update()
GuildUnavailableException
- if the guild is temporarily unavailableprotected boolean needToUpdate()
protected void checkAvailable()
protected void checkNull(java.lang.Object obj, java.lang.String name)
protected void checkPermission(Permission perm)