Class ReadonlyUser

  • All Implemented Interfaces:
    org.json.JSONString

    public class ReadonlyUser
    extends Object
    implements org.json.JSONString
    Readonly POJO of a discord user
    • Constructor Detail

      • ReadonlyUser

        public ReadonlyUser​(long id,
                            short discriminator,
                            boolean bot,
                            @NotNull
                            @NotNull String name,
                            @Nullable
                            @Nullable String avatar)
    • 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, or null if no avatar is set.
        Returns:
        The avatar id
      • toString

        public String toString()
        JSON representation of this user
        Overrides:
        toString in class Object
        Returns:
        THe JSON representation of this user
      • toJSONString

        public String toJSONString()
        Specified by:
        toJSONString in interface org.json.JSONString