Interface User

All Superinterfaces:
Entity, Mentionable, Snowflake, Timestamped
All Known Subinterfaces:
ApplicationOwner
All Known Implementing Classes:
ApplicationOwnerImpl, UserImpl

public interface User extends Snowflake, Mentionable
A single Discord user.
Since:
9/4/18
Author:
amy
  • Method Details

    • animatedAvatar

      @CheckReturnValue boolean animatedAvatar()
      Whether the user's avatar is animated.
      Returns:
      True if the avatar is animated, false otherwise.
    • defaultAvatarUrl

      @Nonnull @CheckReturnValue String defaultAvatarUrl()
      The URL for the default avatar for this user.
      Returns:
      String containing the URL to the default avatar. Never null.
    • avatarUrl

      @Nullable @CheckReturnValue String avatarUrl(@Nonnull ImageOptions options)
      The URL for the user's set avatar. Can be null if the user has not set an avatar.
      Parameters:
      options - Image Options.
      Returns:
      String containing the URL to their avatar, options considered. Can be null.
      See Also:
    • avatarUrl

      @Nullable @CheckReturnValue String avatarUrl()
      The URL for the user's set avatar. Can be null if the user has not set an avatar.
      Returns:
      String containing the URL to their avatar. Can be null.
      See Also:
    • effectiveAvatarUrl

      @Nonnull @CheckReturnValue String effectiveAvatarUrl(@Nonnull ImageOptions options)
      The URL for the user's effective avatar, as displayed in the Discord client.
      Convenience method for getting the user's default avatar when avatarUrl() is null.
      Parameters:
      options - Image Options.
      Returns:
      String containing a URL to their effective avatar, options considered. Never null.
    • effectiveAvatarUrl

      @Nonnull @CheckReturnValue String effectiveAvatarUrl()
      The URL for the user's effective avatar, as displayed in the Discord client.
      Convenience method for getting the user's default avatar when avatarUrl() is null.
      Returns:
      String containing a URL to their effective avatar. Never null.
    • username

      @Nonnull @CheckReturnValue String username()
      The username of the user.
      Returns:
      User's name. Never null.
    • effectiveName

      @Nonnull @CheckReturnValue default String effectiveName(@Nonnull Guild guild)
      The user's effective name shown in a guild.
      Returns:
      User's nickname in the guild, if set, otherwise the username.
    • discriminator

      @Nonnull @CheckReturnValue String discriminator()
      Discriminator of the user, used to tell Amy#0001 from Amy#0002.
      Returns:
      4 digit discriminator as a string. Never null.
    • discordTag

      @Nonnull @CheckReturnValue default String discordTag()
      The DiscordTag of the user, which is the username, an hash, and the discriminator.
      Returns:
      User's DiscordTag. Never null.
    • avatar

      @Nullable @CheckReturnValue String avatar()
      User's avatar hash.
      This does not return their avatar URL nor image directly.
      Returns:
      User's hashed avatar string. Can be null.
      See Also:
    • bot

      @CheckReturnValue boolean bot()
      Whether the user is a bot, or webhook/fake user.
      Returns:
      True if the user is a bot, false if the user is a human.
    • publicFlags

      @Nonnull @CheckReturnValue Set<UserFlag> publicFlags()
      The public flags on a user's account. Public flags are a currently-undocumented subset of all user flags.
      Returns:
      The public flags on a user's account.
    • accentColor

      @CheckReturnValue int accentColor()
      Returns:
      The user's profile accent colour.
    • banner

      @Nullable @CheckReturnValue String banner()
      Returns:
      The hash of the user's banner if it exists
    • presence

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<Presence> presence()
      Returns:
      The user's presence, or null if no presence is cached.
    • createDM

      @CheckReturnValue default io.reactivex.rxjava3.core.Single<DMChannel> createDM()
      Creates a DM channel with this user.
      Returns:
      Future with the result of the DM creation.
    • asMention

      @Nonnull @CheckReturnValue default String asMention()
      Specified by:
      asMention in interface Mentionable
      Returns:
      A mention for this entity that can be sent in a message.