public class EmoteManagerUpdatable
extends java.lang.Object
updatable
manager that allows
to modify emote settings like the name
.
This manager allows to modify multiple fields at once
by getting the EmoteField
for specific
properties and setting or resetting their values; followed by a call of update()
!
The EmoteManager
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_EMOTES
and
must be from AccountType.CLIENT
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
NAME_PATTERN |
Constructor and Description |
---|
EmoteManagerUpdatable(net.dv8tion.jda.core.entities.impl.EmoteImpl emote)
Creates a new EmoteManagerUpdatable instance
|
Modifier and Type | Method and Description |
---|---|
Emote |
getEmote()
The target
Emote
that will be modified by this Manager |
Guild |
getGuild()
|
JDA |
getJDA()
The
JDA instance of this Manager |
EmoteField<java.lang.String> |
getNameField()
An
EmoteField
for the name of the selected Emote . |
EmoteField<java.util.Collection<Role>> |
getRolesField()
Deprecated.
This setting is only available to whitelisted accounts and may be removed in successive builds.
|
void |
reset()
Resets all
Fields
for this manager instance by calling Field.reset() sequentially
This is automatically called by update() |
AuditableRestAction<java.lang.Void> |
update()
Creates a new
RestAction instance
that will apply all changes that have been made to this manager instance. |
public EmoteManagerUpdatable(net.dv8tion.jda.core.entities.impl.EmoteImpl emote)
emote
- The target EmoteImpl
to modifyAccountTypeException
- If the currently logged in account is not from AccountType.CLIENT
java.lang.IllegalStateException
- If the specified Emote is fake
or managed
.public Emote getEmote()
Emote
that will be modified by this Managerpublic EmoteField<java.lang.String> getNameField()
EmoteField
for the name of the selected Emote
.
To set the value use setValue(String)
on the returned EmoteField
instance.
An emote name must be an alphanumeric-with-underscores String between 2-32 chars in length!
Otherwise Field.setValue(...)
will
throw an IllegalArgumentException
.
Example names: fmgSUP
, tatDAB
EmoteField
- Type: String
@Deprecated public EmoteField<java.util.Collection<Role>> getRolesField()
EmoteField
for the restriction roles of the selected Emote
.
To set the value use setValue(Collection)
on the returned EmoteField
instance.
An emote's restricted roles must not contain null
!
Otherwise Field.setValue(...)
will
throw an IllegalArgumentException
.
EmoteField
- Type: Collection
public void reset()
Fields
for this manager instance by calling Field.reset()
sequentially
update()
@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_EMOJI
MISSING_ACCESS
MISSING_PERMISSIONS
MANAGE_EMOTES Permission
before finishing the taskAuditableRestAction
InsufficientPermissionException
- If the currently logged in account does not have the Permission MANAGE_EMOTES
in the underlying Guild
.