Package net.dv8tion.jda.api.entities
Interface UserSnowflake
- All Superinterfaces:
Formattable
,IMentionable
,ISnowflake
Represents an abstract user reference by only the user ID.
This is used for methods which only need a user ID to function, you cannot use this for getting names or similar.
To get information about a user by their ID you can use JDA.retrieveUserById(long)
or JDA.getUserById(long)
instead.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic UserSnowflake
fromId
(long id) Creates a User instance which only wraps an ID.static UserSnowflake
Creates a User instance which only wraps an ID.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
-
Method Details
-
fromId
Creates a User instance which only wraps an ID.- Parameters:
id
- The user id- Returns:
- A user snowflake instance
- See Also:
-
fromId
Creates a User instance which only wraps an ID.- Parameters:
id
- The user id- Returns:
- A user snowflake instance
- Throws:
IllegalArgumentException
- If the provided ID is not a valid snowflake- See Also:
-