public class AccountManager
extends net.dv8tion.jda.core.managers.impl.ManagerBase
Example
manager.setName("Minn")
.setAvatar(null)
.queue();
manager.reset(AccountManager.NAME | AccountManager.AVATAR)
.setName("DV8FromTheWorld")
.setAvatar(icon)
.queue();
JDA.getSelfUser()
,
SelfUser.getManager()
AuditableRestAction.EmptyRestAction<T>
Modifier and Type | Field | Description |
---|---|---|
static long |
AVATAR |
Used to reset the avatar field
|
static long |
EMAIL |
Used to reset the email field
|
static long |
NAME |
Used to reset the name field
|
static long |
PASSWORD |
Used to reset the password field
|
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor | Description |
---|---|
AccountManager(SelfUser selfUser) |
Creates a new AccountManager instance
|
Modifier and Type | Method | Description |
---|---|---|
SelfUser |
getSelfUser() |
The
SelfUser that will be
modified by this AccountManager. |
AccountManager |
reset() |
Resets all fields for this manager.
|
AccountManager |
reset(long fields) |
Resets the fields specified by the provided bit-flag pattern.
|
AccountManager |
reset(long... fields) |
Resets the fields specified by the provided bit-flag patterns.
|
AccountManager |
setAvatar(Icon avatar) |
Sets the avatar for the currently logged in account
|
AccountManager |
setAvatar(Icon avatar,
java.lang.String currentPassword) |
Sets the avatar for the currently logged in account
|
AccountManager |
setEmail(java.lang.String email,
java.lang.String currentPassword) |
Sets the email for the currently logged in client account.
|
AccountManager |
setName(java.lang.String name) |
Sets the username for the currently logged in account
|
AccountManager |
setName(java.lang.String name,
java.lang.String currentPassword) |
Sets the username for the currently logged in account
|
AccountManager |
setPassword(java.lang.String newPassword,
java.lang.String currentPassword) |
Sets the password for the currently logged in client account.
|
reason, setCheck
complete, isPermissionChecksEnabled, queue, setPermissionChecksEnabled
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
complete, completeAfter, getJDA, isPassContext, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfter
public static final long NAME
public static final long AVATAR
public static final long EMAIL
public static final long PASSWORD
public SelfUser getSelfUser()
SelfUser
that will be
modified by this AccountManager.
@CheckReturnValue public AccountManager reset(long fields)
manager.reset(AccountManager.NAME | AccountManager.AVATAR);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer value containing the flags to reset.@CheckReturnValue public AccountManager reset(long... fields)
manager.reset(AccountManager.NAME, AccountManager.AVATAR);
Flag Constants:
reset
in class net.dv8tion.jda.core.managers.impl.ManagerBase
fields
- Integer values containing the flags to reset.@CheckReturnValue public AccountManager reset()
@CheckReturnValue public AccountManager setName(java.lang.String name)
Client-Accounts (AccountType.CLIENT
) require the
current password to be updated. See setName(String, String)
name
- The new usernamejava.lang.IllegalArgumentException
- If the provided name is:
null
2
or more than 32
characters in length@CheckReturnValue public AccountManager setName(java.lang.String name, java.lang.String currentPassword)
name
- The new usernamecurrentPassword
- The current password for the represented account,
this is only required for AccountType.CLIENT
java.lang.IllegalArgumentException
- If this is action is performed on an account with the type CLIENT
and the provided password is null
or empty
null
@CheckReturnValue public AccountManager setAvatar(Icon avatar)
Client-Accounts (AccountType.CLIENT
) require the
current password to be updated. See #setAvatar(Icon, String)
avatar
- An Icon
instance representing
the new Avatar for the current account, null
to reset the avatar to the default avatar.@CheckReturnValue public AccountManager setAvatar(Icon avatar, java.lang.String currentPassword)
avatar
- An Icon
instance representing
the new Avatar for the current account, null
to reset the avatar to the default avatar.currentPassword
- The current password for the represented account,
this is only required for AccountType.CLIENT
java.lang.IllegalArgumentException
- If the provided currentPassword
is null
or empty and the currently
logged in account is from AccountType.CLIENT
@CheckReturnValue public AccountManager setEmail(java.lang.String email, java.lang.String currentPassword)
email
- The new emailcurrentPassword
- The valid current password for the represented accountAccountTypeException
- If the currently logged in account is not from AccountType.CLIENT
java.lang.IllegalArgumentException
- currentPassword
or the provided email
is null
or empty
email
is not valid.@CheckReturnValue public AccountManager setPassword(java.lang.String newPassword, java.lang.String currentPassword)
newPassword
- The new password for the currently logged in accountcurrentPassword
- The valid current password for the represented accountAccountTypeException
- If the currently logged in account is not from AccountType.CLIENT
java.lang.IllegalArgumentException
- If any of the provided passwords are null
or empty