Package net.dv8tion.jda.api.managers
Interface AccountManager
- All Superinterfaces:
AuditableRestAction<Void>
,Manager<AccountManager>
,RestAction<Void>
Manager providing functionality to update one or more fields for the logged in account.
Example
manager.setAvatar(null).queue();
manager.reset(AccountManager.AVATAR)
.setAvatar(icon)
.queue();
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Used to reset the avatar fieldstatic final long
Used to reset the banner fieldstatic final long
Used to reset the name fieldFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptionTheSelfUser
that will be modified by this AccountManager.reset
(long fields) Resets the fields specified by the provided bit-flag pattern.reset
(long... fields) Resets the fields specified by the provided bit-flag patterns.Sets the avatar for the currently logged in accountSets the banner for the currently logged in accountSets the username for the currently logged in accountMethods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Field Details
-
NAME
static final long NAMEUsed to reset the name field- See Also:
-
AVATAR
static final long AVATARUsed to reset the avatar field- See Also:
-
BANNER
static final long BANNERUsed to reset the banner field- See Also:
-
-
Method Details
-
getSelfUser
TheSelfUser
that will be modified by this AccountManager.
This represents the currently logged in account.- Returns:
- The corresponding SelfUser
-
reset
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(AccountManager.NAME | AccountManager.AVATAR);
Flag Constants:
- Specified by:
reset
in interfaceManager<AccountManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- AccountManager for chaining convenience
-
reset
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(AccountManager.NAME, AccountManager.AVATAR);
Flag Constants:
- Specified by:
reset
in interfaceManager<AccountManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- AccountManager for chaining convenience
-
setName
Sets the username for the currently logged in account- Parameters:
name
- The new username- Returns:
- AccountManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided name is:- Equal to
null
- Less than
2
or more than32
characters in length
- Equal to
-
setAvatar
Sets the avatar for the currently logged in account- Parameters:
avatar
- AnIcon
instance representing the new Avatar for the current account,null
to reset the avatar to the default avatar.- Returns:
- AccountManager for chaining convenience
-
setBanner
Sets the banner for the currently logged in account- Parameters:
banner
- AnIcon
instance representing the new banner for the current account,null
to reset the banner to the default banner.- Returns:
- AccountManager for chaining convenience
-