User
Represents a Discord user.Attributes
The user’s unique ID.
The user’s username.
The user’s discriminator. This is given when the username has conflicts.
If the user has migrated to the new username system, this will always be “0”.
The user’s global name.
Specifies if the user is a bot account.
Specifies if the user is a system user (i.e. represents Discord officially).
Returns an
Asset for the avatar the user has. If the user does not have a traditional avatar, None is returned.Returns the default avatar for a given user. This is calculated by the user’s ID if they’re on the new username system, otherwise their discriminator.
Returns the user’s display avatar. For regular users this is just their default avatar or uploaded avatar.
Returns the user’s banner asset, if available.
This information is only available via
Client.fetch_user().Returns the user’s accent colour, if applicable. Aliased to
accent_color.This information is only available via
Client.fetch_user().Returns the user’s display name. This will be their global name if set, otherwise their username.
Returns a string that allows you to mention the given user.
Returns the user’s creation time in UTC. This is when the user’s Discord account was created.
The publicly available flags the user has.
Returns a URL that allows the client to jump to the user.
Returns the channel associated with this user if it exists. If this returns None, you can create a DM channel by calling the
create_dm() coroutine function.The guilds that the user shares with the client.
This will only return mutual guilds within the client’s internal cache.
Methods
async send(content, **options)
async send(content, **options)
async create_dm()
async create_dm()
Creates a Returns:
DMChannel with this user.This should be rarely called, as this is done transparently for most people.
DMChannel - The channel that was created.Example:mentioned_in(message)
mentioned_in(message)
Checks if the user is mentioned in the specified message.Returns:
The message to check if you’re mentioned in.
bool - Indicates if the user is mentioned in the message.Example:is_migrated()
is_migrated()
Checks whether the user is already migrated to global name.Returns:
bool - True if the user has migrated to the new username system.Example:ClientUser
Represents your Discord user (the bot’s user account).Additional Attributes
Specifies if the user’s email is verified.
The IETF language tag used to identify the language the user is using.
Specifies if the user has MFA turned on and working.
Additional Methods
async edit(**options)
async edit(**options)
Edits the current profile of the client.Returns:
To upload an avatar or banner, a bytes-like object must be passed in that represents the image being uploaded.
The new username you wish to change to.
A bytes-like object representing the image to upload. Could be None to denote no avatar.
A bytes-like object representing the image to upload. Could be None to denote no banner.
ClientUser - The newly edited client user.Example: