Package net.dv8tion.jda.api.managers
Interface AccountManager
-
- All Superinterfaces:
AuditableRestAction<java.lang.Void>,Manager<AccountManager>,RestAction<java.lang.Void>
public interface AccountManager extends Manager<AccountManager>
Manager providing functionality to update one or more fields for the logged in account.Example
manager.setName("Minn") .setAvatar(null) .queue(); manager.reset(AccountManager.NAME | AccountManager.AVATAR) .setName("DV8FromTheWorld") .setAvatar(icon) .queue();- See Also:
JDA.getSelfUser(),SelfUser.getManager()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SelfUsergetSelfUser()TheSelfUserthat will be modified by this AccountManager.AccountManagerreset(long fields)Resets the fields specified by the provided bit-flag pattern.AccountManagerreset(long... fields)Resets the fields specified by the provided bit-flag patterns.AccountManagersetAvatar(Icon avatar)Sets the avatar for the currently logged in accountAccountManagersetName(java.lang.String name)Sets the username for the currently logged in account-
Methods 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, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
-
-
-
Field Detail
-
NAME
static final long NAME
Used to reset the name field- See Also:
- Constant Field Values
-
AVATAR
static final long AVATAR
Used to reset the avatar field- See Also:
- Constant Field Values
-
-
Method Detail
-
getSelfUser
@Nonnull SelfUser getSelfUser()
TheSelfUserthat will be modified by this AccountManager.
This represents the currently logged in account.- Returns:
- The corresponding SelfUser
-
reset
@Nonnull @CheckReturnValue AccountManager reset(long fields)
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:
resetin interfaceManager<AccountManager>- Parameters:
fields- Integer value containing the flags to reset.- Returns:
- AccountManager for chaining convenience
-
reset
@Nonnull @CheckReturnValue AccountManager reset(long... fields)
Resets the fields specified by the provided bit-flag patterns. 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:
resetin interfaceManager<AccountManager>- Parameters:
fields- Integer values containing the flags to reset.- Returns:
- AccountManager for chaining convenience
-
setName
@Nonnull @CheckReturnValue AccountManager setName(@Nonnull java.lang.String name)
Sets the username for the currently logged in account- Parameters:
name- The new username- Returns:
- AccountManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException- If the provided name is:- Equal to
null - Less than
2or more than32characters in length
- Equal to
-
setAvatar
@Nonnull @CheckReturnValue AccountManager setAvatar(@Nullable Icon avatar)
Sets the avatar for the currently logged in account- Parameters:
avatar- AnIconinstance representing the new Avatar for the current account,nullto reset the avatar to the default avatar.- Returns:
- AccountManager for chaining convenience
-
-