Overview
The User interface represents a Discord user account across the entire platform. For guild-specific user information, see Member.Key Properties
Basic Information
The Snowflake id of this User.
The Snowflake id of this User as a primitive long.
The username of the User. Length is between 2 and 32 characters (inclusive).
The global display name of the user. This name is not unique and allows more characters.Returns
null if unset.The name visible in the UI. If the global name is
null, this returns the username instead.The discriminator of the User. Used to differentiate between users with the same usernames.For most users, this will be
"0000". The primary use-case for discriminators is bot and guest accounts.The “tag” for this user (username#discriminator).Users without a discriminator use
#0000 instead.Avatar and Profile
The Discord ID for this user’s avatar image.Returns
null if the user has not set an avatar.The URL for the user’s avatar image.Returns
null if the user has not set an avatar.The URL for the user’s avatar image. If they do not have an avatar set, this will return the URL of their default avatar.
The URL for the user’s default avatar image.
Account Type
Returns whether or not the given user is a Bot account (special badge in client, some different behavior).
Returns whether or not the given user is a System account, which includes the urgent message account and the community updates bot.
User Flags
Returns the UserFlags of this user.
Returns the bitmask representation of the UserFlags of this user.
User Actions
Direct Messaging
Opens a PrivateChannel with this User.If a channel has already been opened, it is immediately returned without contacting the Discord API.
Whether the currently logged in user and this user have a currently open PrivateChannel.
Profile Data
Loads the user’s Profile data including banner and accent color.
Guild Information
Finds and collects all Guild instances that contain this User within the current JDA instance.
Static Methods
Creates a User instance which only wraps an ID.Useful for operations that only require a user ID.
Creates a User instance which only wraps an ID (string version).
User.Profile
The Profile class contains additional user information that requires an API request.The Discord Id for this user’s banner image.Returns
null if the user has not set a banner.The URL for the user’s banner image.Returns
null if the user has not set a banner.The user’s accent color.Returns
null if the user has not set an accent color.The raw RGB value of this user’s accent color.Defaults to
User.DEFAULT_ACCENT_COLOR_RAW if not available.User Flags
The UserFlag enum represents public badges and account types:STAFF- Discord EmployeePARTNER- Partnered Server OwnerHYPESQUAD- HypeSquad EventsBUG_HUNTER_LEVEL_1- Bug Hunter Level 1BUG_HUNTER_LEVEL_2- Bug Hunter Level 2HYPESQUAD_BRAVERY- HypeSquad BraveryHYPESQUAD_BRILLIANCE- HypeSquad BrillianceHYPESQUAD_BALANCE- HypeSquad BalanceEARLY_SUPPORTER- Early SupporterVERIFIED_BOT- Verified BotVERIFIED_DEVELOPER- Early Verified Bot DeveloperCERTIFIED_MODERATOR- Discord Certified ModeratorBOT_HTTP_INTERACTIONS- HTTP Interactions BotACTIVE_DEVELOPER- Active Developer