public interface User extends ISnowflake, IMentionable, IFakeable
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAvatarId()
The Discord Id for this user's avatar image.
|
java.lang.String |
getAvatarUrl()
The URL for the user's avatar image.
|
java.lang.String |
getDefaultAvatarId()
The Discord Id for this user's default avatar image.
|
java.lang.String |
getDefaultAvatarUrl()
The URL for the for the user's default avatar image.
|
java.lang.String |
getDiscriminator()
The discriminator of the User . |
java.lang.String |
getEffectiveAvatarUrl()
The URL for the user's avatar image
If they do not have an avatar set, this will return the URL of their
default avatar
|
JDA |
getJDA()
Returns the
JDA instance of this User |
java.util.List<Guild> |
getMutualGuilds()
|
java.lang.String |
getName()
The username of the
User . |
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 |
isBot()
Returns whether or not the given user is a Bot-Account (special badge in client, some different behaviour)
|
RestAction<PrivateChannel> |
openPrivateChannel()
Opens a
PrivateChannel with this User. |
getCreationTime, getId
formatTo, getAsMention
java.lang.String getName()
User
. Length is between 2 and 32 characters (inclusive).User
's username.java.lang.String getDiscriminator()
User
. Used to differentiate between users with the same usernames.
User
discriminator.java.lang.String getAvatarId()
User
avatar id.java.lang.String getAvatarUrl()
User
avatar url.java.lang.String getDefaultAvatarId()
User
default avatar id.java.lang.String getDefaultAvatarUrl()
User
default avatar url.java.lang.String getEffectiveAvatarUrl()
User
effective avatar url.boolean hasPrivateChannel()
PrivateChannel
or not.RestAction<PrivateChannel> openPrivateChannel()
PrivateChannel
with this User.
The following ErrorResponses
are possible:
CANNOT_SEND_TO_USER
RestAction
- Type: PrivateChannel
java.lang.UnsupportedOperationException
- If the recipient User is the currently logged in account (represented by SelfUser
)java.lang.IllegalStateException
- If this User is fake
java.util.List<Guild> getMutualGuilds()
Guild
instances that contain this User
within the current JDA
instance.This method is a shortcut for JDA.getMutualGuilds(User)
.
Guilds
that this user is a member of.PrivateChannel getPrivateChannel()
PrivateChannel
of this
User
for use in sending direct messages.PrivateChannel
that is associated with this User
.java.lang.IllegalStateException
- If JDA does not have a private channel cached for this user. Use hasPrivateChannel()
to check
and openPrivateChannel()
to open a channel.boolean isBot()