Package net.dv8tion.jda.api.entities
Interface SelfUser
-
- All Superinterfaces:
Formattable
,IFakeable
,IMentionable
,ISnowflake
,User
public interface SelfUser extends User
Represents the currently logged in account.- See Also:
JDA.getSelfUser()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.User
User.UserFlag
-
-
Field Summary
-
Fields inherited from interface net.dv8tion.jda.api.entities.User
AVATAR_URL, DEFAULT_AVATAR_URL, USER_TAG
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description long
getAllowedFileSize()
Returns the maximum size for files that can be uploaded with this account.default String
getEmail()
Deprecated.This is no longer supportedAccountManager
getManager()
TheAccountManager
for the currently logged in account.default String
getPhoneNumber()
Deprecated.This is no longer supportedboolean
isMfaEnabled()
If true, this account is protected by Multi-Factor authorization.default boolean
isMobile()
Deprecated.This is no longer supporteddefault boolean
isNitro()
Deprecated.This is no longer supportedboolean
isVerified()
The status of this account's verification.-
Methods inherited from interface net.dv8tion.jda.api.entities.IMentionable
formatTo, getAsMention
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Methods inherited from interface net.dv8tion.jda.api.entities.User
getAsTag, getAvatarId, getAvatarUrl, getDefaultAvatarId, getDefaultAvatarUrl, getDiscriminator, getEffectiveAvatarUrl, getFlags, getFlagsRaw, getJDA, getMutualGuilds, getName, hasPrivateChannel, isBot, openPrivateChannel
-
-
-
-
Method Detail
-
isVerified
boolean isVerified()
The status of this account's verification. (Have you accepted the verification email)- Returns:
- True, if this account is verified.
-
isMfaEnabled
boolean isMfaEnabled()
If true, this account is protected by Multi-Factor authorization.
If this is a Client account, then this describes the MFA status of the Client account.
If this is a Bot account, then this describes the MFA status of the Client account that owns this Bot.- Returns:
- True, if this account has MFA protecting it.
-
getEmail
@Nonnull @Deprecated @ForRemoval @DeprecatedSince("4.2.0") default String getEmail()
Deprecated.This is no longer supportedUsed to get the email of the currently logged in account.
NOTE: this is aAccountType.CLIENT
method only!- Returns:
- The email of the currently logged in account.
- Throws:
AccountTypeException
- If this method is called whenJDA#getAccountType()
does not returnAccountType.CLIENT
. E.g: If the logged in account isn't a Client account!
-
isMobile
@Deprecated @ForRemoval @DeprecatedSince("4.2.0") default boolean isMobile()
Deprecated.This is no longer supportedShows whether there has ever been a mobile app connected to this account.
NOTE: this is aAccountType.CLIENT
method only!- Returns:
true
if the account is linked with a mobile app, otherwisefalse
- Throws:
AccountTypeException
- If this method is called whenJDA#getAccountType()
does not returnAccountType.CLIENT
. E.g: If the logged in account isn't a Client account!
-
isNitro
@Deprecated @ForRemoval @DeprecatedSince("4.2.0") default boolean isNitro()
Deprecated.This is no longer supportedThe Discord Nitro status of this account.
NOTE: this is aAccountType.CLIENT
method only!- Returns:
- The Discord Nitro status of the currently logged in account.
- Throws:
AccountTypeException
- If this method is called whenJDA#getAccountType()
does not returnAccountType.CLIENT
. E.g: If the logged in account isn't a Client account!
-
getPhoneNumber
@Deprecated @ForRemoval @DeprecatedSince("4.2.0") @Nullable default String getPhoneNumber()
Deprecated.This is no longer supportedUsed to get the phone number of the currently logged in account if a phone number has been attached to it.
NOTE: this is aAccountType.CLIENT
method only!- Returns:
- The phone of the currently logged in account or null if there's no number associated
- Throws:
AccountTypeException
- If this method is called whenJDA#getAccountType()
does not returnAccountType.CLIENT
. E.g: If the logged in account isn't a Client account!
-
getAllowedFileSize
long getAllowedFileSize()
Returns the maximum size for files that can be uploaded with this account.
Returns 8388608 for bots.- Returns:
- The maximum size for files that can be uploaded with this account
- See Also:
Message.MAX_FILE_SIZE
-
getManager
@Nonnull AccountManager getManager()
TheAccountManager
for the currently logged in account.
This can be used to atomically set account fields (like avatar/username) You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Returns:
- An AccountManager instance for the current account
-
-