Class SelfUserImpl
java.lang.Object
net.dv8tion.jda.internal.entities.UserSnowflakeImpl
net.dv8tion.jda.internal.entities.UserImpl
net.dv8tion.jda.internal.entities.SelfUserImpl
- All Implemented Interfaces:
Formattable
,IMentionable
,ISnowflake
,SelfUser
,User
,UserSnowflake
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.User
User.Profile, User.UserFlag
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.User
AVATAR_URL, BANNER_URL, DEFAULT_ACCENT_COLOR_RAW, DEFAULT_AVATAR_URL, USER_TAG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SelfUserImpl
copyOf
(SelfUserImpl other, JDAImpl jda) long
Returns the maximum size for files that can be uploaded with this account.long
The associated application id for the bot account.TheAccountManager
for the currently logged in account.boolean
Whether or not the currently logged in user and this user have a currently openPrivateChannel
or not.boolean
If true, this account is protected by Multi-Factor authorization.boolean
The status of this account's verification.Opens aPrivateChannel
with this User.setApplicationId
(long id) setMfaEnabled
(boolean enabled) setVerified
(boolean verified) Methods inherited from class net.dv8tion.jda.internal.entities.UserImpl
formatTo, getAsTag, getAvatarId, getDefaultAvatarId, getDiscriminator, getDiscriminatorInt, getFlags, getFlagsRaw, getGlobalName, getJDA, getMutualGuilds, getName, getProfile, isBot, isSystem, retrieveProfile, setAvatarId, setBot, setDiscriminator, setFlags, setGlobalName, setName, setPrivateChannel, setProfile, setSystem, toString
Methods inherited from class net.dv8tion.jda.internal.entities.UserSnowflakeImpl
equals, getAsMention, getIdLong, hashCode
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.SelfUser
getApplicationId
Methods inherited from interface net.dv8tion.jda.api.entities.User
getAsTag, getAvatar, getAvatarId, getAvatarUrl, getDiscriminator, getEffectiveAvatar, getEffectiveAvatarUrl, getEffectiveName, getFlags, getFlagsRaw, getGlobalName, getJDA, getMutualGuilds, getName, isBot, isSystem, retrieveProfile
Methods inherited from interface net.dv8tion.jda.api.entities.UserSnowflake
getDefaultAvatar, getDefaultAvatarId, getDefaultAvatarUrl
-
Constructor Details
-
SelfUserImpl
-
-
Method Details
-
hasPrivateChannel
public boolean hasPrivateChannel()Description copied from interface:User
Whether or not the currently logged in user and this user have a currently openPrivateChannel
or not.- Specified by:
hasPrivateChannel
in interfaceUser
- Overrides:
hasPrivateChannel
in classUserImpl
- Returns:
- True if the logged in account shares a PrivateChannel with this user.
-
getPrivateChannel
- Overrides:
getPrivateChannel
in classUserImpl
-
openPrivateChannel
Description copied from interface:User
Opens aPrivateChannel
with this User.
If a channel has already been opened with this user, it is immediately returned in the RestAction's success consumer without contacting the Discord API. You can useuseCache(false)
to force the request for a new channel object, which is rarely useful since the channel id never changes.Examples
// Send message without response handling public void sendMessage(User user, String content) { user.openPrivateChannel() .flatMap(channel -> channel.sendMessage(content)) .queue(); } // Send message and delete 30 seconds later public RestAction<Void> sendSecretMessage(User user, String content) { return user.openPrivateChannel() // RestAction<PrivateChannel> .flatMap(channel -> channel.sendMessage(content)) // RestAction<Message> .delay(30, TimeUnit.SECONDS) // RestAction<Message> with delayed response .flatMap(Message::delete); // RestAction<Void> (executed 30 seconds after sending) }
- Specified by:
openPrivateChannel
in interfaceUser
- Overrides:
openPrivateChannel
in classUserImpl
- Returns:
CacheRestAction
- Type:PrivateChannel
Retrieves the PrivateChannel to use to directly message this User.- See Also:
-
getApplicationIdLong
public long getApplicationIdLong()Description copied from interface:SelfUser
The associated application id for the bot account.
For most bots this is identical to the user id.- Specified by:
getApplicationIdLong
in interfaceSelfUser
- Returns:
- The application id
-
isVerified
public boolean isVerified()Description copied from interface:SelfUser
The status of this account's verification. (Have you accepted the verification email)- Specified by:
isVerified
in interfaceSelfUser
- Returns:
- True, if this account is verified.
-
isMfaEnabled
public boolean isMfaEnabled()Description copied from interface:SelfUser
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.- Specified by:
isMfaEnabled
in interfaceSelfUser
- Returns:
- True, if this account has MFA protecting it.
-
getAllowedFileSize
public long getAllowedFileSize()Description copied from interface:SelfUser
Returns the maximum size for files that can be uploaded with this account.
Returns 10485760 for bots.- Specified by:
getAllowedFileSize
in interfaceSelfUser
- Returns:
- The maximum size for files that can be uploaded with this account
- See Also:
-
getManager
Description copied from interface:SelfUser
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()
.- Specified by:
getManager
in interfaceSelfUser
- Returns:
- An AccountManager instance for the current account
-
setVerified
-
setMfaEnabled
-
setApplicationId
-
copyOf
-