public class SelfUserImpl extends UserImpl implements SelfUser
api, avatarId, bot, discriminator, fake, id, name, privateChannel
Constructor and Description |
---|
SelfUserImpl(java.lang.String id,
JDAImpl api) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEmail()
Used to get the email of the currently logged in account.
NOTE: this is a AccountType.CLIENT method only! |
PrivateChannel |
getPrivateChannel()
Gets the
PrivateChannel of this
User for use in sending direct messages. |
boolean |
hasPrivateChannel()
Whether or not the currently logged in user and this user have a currently open
PrivateChannel or not. |
boolean |
isMfaEnabled()
If true, this account is protected by Multi-Factor authorizaiton.
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. |
boolean |
isVerified()
The status of this account's verification.
(Have you accepted the verification email) |
RestAction<PrivateChannel> |
openPrivateChannel() |
SelfUserImpl |
setEmail(java.lang.String email) |
SelfUserImpl |
setMfaEnabled(boolean enabled) |
SelfUserImpl |
setVerified(boolean verified) |
equals, getAsMention, getAvatarId, getAvatarUrl, getDefaultAvatarId, getDefaultAvatarUrl, getDiscriminator, getId, getJDA, getName, hashCode, isBot, isFake, setAvatarId, setBot, setDiscriminator, setFake, setName, setPrivateChannel, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAvatarId, getAvatarUrl, getDefaultAvatarId, getDefaultAvatarUrl, getDiscriminator, getJDA, getName, isBot
getCreationTime, getId
getAsMention
public SelfUserImpl(java.lang.String id, JDAImpl api)
public boolean hasPrivateChannel()
User
PrivateChannel
or not.hasPrivateChannel
in interface User
hasPrivateChannel
in class UserImpl
public PrivateChannel getPrivateChannel()
User
PrivateChannel
of this
User
for use in sending direct messages.getPrivateChannel
in interface User
getPrivateChannel
in class UserImpl
PrivateChannel
that is associated with this User
.public RestAction<PrivateChannel> openPrivateChannel()
openPrivateChannel
in interface User
openPrivateChannel
in class UserImpl
public boolean isVerified()
SelfUser
isVerified
in interface SelfUser
public boolean isMfaEnabled()
SelfUser
isMfaEnabled
in interface SelfUser
public java.lang.String getEmail() throws AccountTypeException
SelfUser
AccountType.CLIENT
method only!getEmail
in interface SelfUser
AccountTypeException
- If this method is called when JDA#getAccountType()
does not return
AccountType.CLIENT
. E.g: If the logged in account isn't a Client account!public SelfUserImpl setVerified(boolean verified)
public SelfUserImpl setMfaEnabled(boolean enabled)
public SelfUserImpl setEmail(java.lang.String email)