Class ReadonlyUser
- java.lang.Object
-
- club.minnced.discord.webhook.receive.ReadonlyUser
-
- All Implemented Interfaces:
org.json.JSONString
public class ReadonlyUser extends Object implements org.json.JSONString
Readonly POJO of a discord user
-
-
Constructor Summary
Constructors Constructor Description ReadonlyUser(long id, short discriminator, boolean bot, @NotNull String name, @Nullable String avatar)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable String
getAvatarId()
The avatar id of this user, ornull
if no avatar is set.String
getDiscriminator()
The 4 digit discriminator of this user
This is show in the client after the#
when viewing profiles.long
getId()
The id of this user@NotNull String
getName()
The name of this user, this is the username and not the guild-specific nickname.boolean
isBot()
Whether this is a bot or not, webhook authors are always bots.String
toJSONString()
String
toString()
JSON representation of this user
-
-
-
Method Detail
-
getId
public long getId()
The id of this user- Returns:
- The id
-
getDiscriminator
public String getDiscriminator()
The 4 digit discriminator of this user
This is show in the client after the#
when viewing profiles.- Returns:
- The discriminator
-
isBot
public boolean isBot()
Whether this is a bot or not, webhook authors are always bots.- Returns:
- True, if this is a bot
-
getName
@NotNull @JSONPropertyName("username") public @NotNull String getName()
The name of this user, this is the username and not the guild-specific nickname.- Returns:
- The name of this user
-
getAvatarId
@Nullable @JSONPropertyName("avatar_id") public @Nullable String getAvatarId()
The avatar id of this user, ornull
if no avatar is set.- Returns:
- The avatar id
-
toString
public String toString()
JSON representation of this user
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.JSONString
-
-