Package de.jcm.discordgamesdk.user
Class DiscordUser
java.lang.Object
de.jcm.discordgamesdk.user.DiscordUser
Representation of a Discord user.
Only used as output from SDK functions.
- See Also:
-
Constructor Summary
ConstructorDescriptionDiscordUser
(long userId) Create a new Discord user object used to request a user by UID.DiscordUser
(long userId, String username, String discriminator, String avatar, Boolean bot) Create a new Discord user object, holding the data provided as arguments. -
Method Summary
Modifier and TypeMethodDescriptionReturns the resource key to the users avatar.Returns the Discord-Tag of the user.int
getFlags()
long
Returns the ID of the Discord user.Returns the Discord-Name of the user.boolean
isBot()
Tells you if the user is a bot.toString()
Generates a string representation of the user containing all its attributes.
-
Constructor Details
-
DiscordUser
Create a new Discord user object, holding the data provided as arguments.
You probably do not want to construct the class, since it is mainly used for output.
- Parameters:
userId
- ID of the user, a Discord snowflakeusername
- Discord-Namediscriminator
- Discord-Tagavatar
- Resource key of the user's avatorbot
-true
if the user is a bot
-
DiscordUser
public DiscordUser(long userId) Create a new Discord user object used to request a user by UID.
You probably do not want to construct the class, since it is mainly used for output.
- Parameters:
userId
- ID of the user, a Discord snowflake
-
-
Method Details
-
getUserId
public long getUserId()Returns the ID of the Discord user.- Returns:
- A Discord snowflake
-
getUsername
Returns the Discord-Name of the user.- Returns:
- The Discord-Name
-
getDiscriminator
Returns the Discord-Tag of the user.- Returns:
- The Discord-Tag
-
getAvatar
Returns the resource key to the users avatar.
You can find the avatar image at:
https://cdn.discordapp.com/avatars/<user id>/<resource key>.png- Returns:
- A resource key
-
isBot
public boolean isBot()Tells you if the user is a bot.- Returns:
true
if the user is a bot
-
getFlags
public int getFlags() -
toString
Generates a string representation of the user containing all its attributes.
This is just one of IntelliJ IDEA's default
toString()
-Methods, so don't expect anything special.
-