Interface UserSnowflake

All Superinterfaces:
Formattable, IMentionable, ISnowflake
All Known Subinterfaces:
Member, SelfMember, SelfUser, User

public interface UserSnowflake extends IMentionable
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 Details

    • fromId

      @Nonnull static UserSnowflake fromId(long id)
      Creates a User instance which only wraps an ID.
      Parameters:
      id - The user id
      Returns:
      A user snowflake instance
      See Also:
    • fromId

      @Nonnull static UserSnowflake fromId(@Nonnull String id)
      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:
    • getDefaultAvatarId

      @Nonnull String getDefaultAvatarId()
      The Discord ID for this user's default avatar image.
      Returns:
      Never-null String containing the user's default avatar id.
    • getDefaultAvatarUrl

      @Nonnull default String getDefaultAvatarUrl()
      The URL for the user's default avatar image.
      Returns:
      Never-null String containing the user's default avatar url.
    • getDefaultAvatar

      @Nonnull default ImageProxy getDefaultAvatar()
      Returns an ImageProxy for this user's default avatar.
      Returns:
      Never-null ImageProxy of this user's default avatar
      See Also: