Class DiscordUser

java.lang.Object
de.jcm.discordgamesdk.user.DiscordUser

public class DiscordUser extends Object

Representation of a Discord user.

Only used as output from SDK functions.

See Also:
  • Constructor Details

    • DiscordUser

      public DiscordUser(long userId, String username, String discriminator, String avatar, Boolean bot)

      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 snowflake
      username - Discord-Name
      discriminator - Discord-Tag
      avatar - Resource key of the user's avator
      bot - 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

      public String getUsername()
      Returns the Discord-Name of the user.
      Returns:
      The Discord-Name
    • getDiscriminator

      public String getDiscriminator()
      Returns the Discord-Tag of the user.
      Returns:
      The Discord-Tag
    • getAvatar

      public String 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

      public String 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.

      Overrides:
      toString in class Object
      Returns:
      A string representation of the user