Skip to content

hikari.users#

Application and entities that are used to describe Users on Discord.

AvatarDecoration #

Data for an avatar decoration.

asset_hash class-attribute instance-attribute #

asset_hash: str = field(repr=True)

The hash of the asset.

expires_at class-attribute instance-attribute #

expires_at: datetime | None = field(repr=True)

The datetime at which the user will no longer have access to the avatar decoration.

sku_id class-attribute instance-attribute #

sku_id: Snowflake = field(repr=True)

The ID of the asset's SKU.

url property #

url: URL

Default image URL for this avatar decoration.

make_url #

make_url(
    *,
    file_format: UndefinedOr[
        Literal["PNG", "JPEG", "JPG", "WEBP", "APNG"]
    ] = UNDEFINED,
    size: int = 4096,
    lossless: bool = True,
) -> URL

Generate the image URL for this avatar decoration.

PARAMETER DESCRIPTION
file_format

The format to use for this URL.

Supports PNG, JPEG, JPG, WEBP, and APNG.

If not specified, the format will be PNG or APNG based on whether the decoration is animated or not.

TYPE: UndefinedOr[Literal['PNG', 'JPEG', 'JPG', 'WEBP', 'APNG']] DEFAULT: UNDEFINED

size

The size to set for the URL; This is ignored for the APNG format; Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

lossless

Whether to return a lossless or compressed WEBP image; This is ignored if file_format is not WEBP.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
URL

The URL to the avatar decoration.

RAISES DESCRIPTION
TypeError

If an invalid format is passed for file_format; If an animated format is requested for a static avatar decoration.

ValueError

If size is specified but is not a power of two or not between 16 and 4096.

OwnUser #

Bases: UserImpl

Represents a user with extended OAuth2 information.

email class-attribute instance-attribute #

email: str | None = field(eq=False, hash=False, repr=False)

The user's set email.

Will be None if retrieved through OAuth2 flow without the email scope. Will always be None for bot users.

is_mfa_enabled class-attribute instance-attribute #

is_mfa_enabled: bool = field(
    eq=False, hash=False, repr=False
)

Whether the user's account has multi-factor authentication enabled.

is_verified class-attribute instance-attribute #

is_verified: bool | None = field(
    eq=False, hash=False, repr=False
)

Whether the email for this user's account has been verified.

Will be None if retrieved through the OAuth2 flow without the email scope.

locale class-attribute instance-attribute #

locale: str | Locale | None = field(
    eq=False, hash=False, repr=False
)

The user's set locale.

This is not provided in the READY event.

premium_type class-attribute instance-attribute #

premium_type: PremiumType | int | None = field(
    eq=False, hash=False, repr=False
)

The type of Nitro Subscription this user account had.

This will always be None for bots.

fetch_dm_channel async #

fetch_dm_channel() -> NoReturn

Fetch the DM channel for this user.

RETURNS DESCRIPTION
DMChannel

The requested channel.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the user is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> OwnUser

Get this user's up-to-date object.

RETURNS DESCRIPTION
OwnUser

The requested user object.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

send async #

Send a message to this user in DM's.

PARAMETER DESCRIPTION
content

If provided, the message contents. If hikari.undefined.UNDEFINED, then nothing will be sent in the content. Any other value here will be cast to a str.

If this is a hikari.embeds.Embed and no embed nor embeds kwarg is provided, then this will instead update the embed. This allows for simpler syntax when sending an embed alone.

Likewise, if this is a hikari.files.Resource, then the content is instead treated as an attachment if no attachment and no attachments kwargs are provided.

TYPE: UndefinedOr[Any] DEFAULT: UNDEFINED

attachment

If provided, the message attachment. This can be a resource, or string of a path on your computer or a URL.

Attachments can be passed as many different things, to aid in convenience.

TYPE: UndefinedOr[Resourceish] DEFAULT: UNDEFINED

attachments

If provided, the message attachments. These can be resources, or strings consisting of paths on your computer or URLs.

TYPE: UndefinedOr[Sequence[Resourceish]] DEFAULT: UNDEFINED

component

If provided, builder object of the component to include in this message.

TYPE: UndefinedOr[ComponentBuilder] DEFAULT: UNDEFINED

components

If provided, a sequence of the component builder objects to include in this message.

TYPE: UndefinedOr[Sequence[ComponentBuilder]] DEFAULT: UNDEFINED

embed

If provided, the message embed.

TYPE: UndefinedOr[Embed] DEFAULT: UNDEFINED

embeds

If provided, the message embeds.

TYPE: UndefinedOr[Sequence[Embed]] DEFAULT: UNDEFINED

tts

If provided, whether the message will be read out by a screen reader using Discord's TTS (text-to-speech) system.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

reply

If provided, the message to reply to.

TYPE: UndefinedOr[SnowflakeishOr[PartialMessage]] DEFAULT: UNDEFINED

reply_must_exist

If provided, whether to error if the message being replied to does not exist instead of sending as a normal (non-reply) message.

This will not do anything if not being used with reply.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

mentions_everyone

If provided, whether the message should parse @everyone/@here mentions.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

mentions_reply

If provided, whether to mention the author of the message that is being replied to.

This will not do anything if not being used with reply.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

user_mentions

If provided, and True, all user mentions will be detected. If provided, and False, all user mentions will be ignored if appearing in the message body. Alternatively this may be a collection of hikari.snowflakes.Snowflake, or hikari.users.PartialUser derivatives to enforce mentioning specific users.

TYPE: UndefinedOr[SnowflakeishSequence[PartialUser] | bool] DEFAULT: UNDEFINED

role_mentions

If provided, and True, all role mentions will be detected. If provided, and False, all role mentions will be ignored if appearing in the message body. Alternatively this may be a collection of hikari.snowflakes.Snowflake, or hikari.guilds.PartialRole derivatives to enforce mentioning specific roles.

TYPE: UndefinedOr[SnowflakeishSequence[PartialRole] | bool] DEFAULT: UNDEFINED

flags

If provided, optional flags to set on the message. If hikari.undefined.UNDEFINED, then nothing is changed.

Note that some flags may not be able to be set. Currently the only flags that can be set are hikari.messages.MessageFlag.NONE and hikari.messages.MessageFlag.SUPPRESS_EMBEDS.

TYPE: UndefinedType | int | MessageFlag DEFAULT: UNDEFINED

RETURNS DESCRIPTION
Message

The created message.

RAISES DESCRIPTION
ValueError

If more than 100 unique objects/entities are passed for role_mentions or user_mentions.

TypeError

If both attachment and attachments are specified.

BadRequestError

This may be raised in several discrete situations, such as messages being empty with no attachments or embeds; messages with more than 2000 characters in them, embeds that exceed one of the many embed limits; too many attachments; attachments that are too large; invalid image URLs in embeds; reply not found or not in the same channel; too many components.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.SEND_MESSAGES in the channel or the person you are trying to message has the DM's disabled.

NotFoundError

If the user is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

PartialUser #

Bases: Unique, ABC

A partial interface for a user.

Fields may or may not be present, and should be explicitly checked before using them to ensure they are not hikari.undefined.UNDEFINED.

This is used for endpoints and events that only expose partial user information.

For full user info, consider calling the hikari.users.PartialUser.fetch_self method to perform an API call.

accent_color abstractmethod property #

accent_color: UndefinedNoneOr[Color]

Custom banner color for the user if set, else None.

The official client will decide the default color if not set.

accent_colour property #

accent_colour: UndefinedNoneOr[Color]

app abstractmethod property #

app: RESTAware

Client application that models may use for procedures.

avatar_decoration abstractmethod property #

avatar_decoration: UndefinedNoneOr[AvatarDecoration]

Avatar decoration for the user, if they have one, otherwise None.

avatar_hash abstractmethod property #

avatar_hash: UndefinedNoneOr[str]

Avatar hash for the user, if they have one, otherwise None.

banner_hash abstractmethod property #

banner_hash: UndefinedNoneOr[str]

Banner hash for the user, if they have one, otherwise None.

discriminator abstractmethod property #

discriminator: UndefinedOr[str]

Discriminator for the user.

!!! deprecated 2.0.0.dev120 Discriminators are deprecated and being replaced with "0" by Discord during username migration. This field will be removed after migration is complete. Learn more here: https://dis.gd/usernames

display_name property #

display_name: UndefinedNoneOr[str]

Return the user's display name.

Either users global name (if set) or its username.

flags abstractmethod property #

Flag bits that are set for the user.

global_name abstractmethod property #

global_name: UndefinedNoneOr[str]

Global name for the user, if they have one, otherwise None.

is_bot abstractmethod property #

is_bot: UndefinedOr[bool]

Whether this user is a bot account.

is_system abstractmethod property #

is_system: UndefinedOr[bool]

Whether this user is a system account.

mention abstractmethod property #

mention: str

Return a raw mention string for the given user.

Examples:

>>> some_user.mention
'<@123456789123456789>'

username abstractmethod property #

username: UndefinedOr[str]

Username for the user.

fetch_dm_channel async #

fetch_dm_channel() -> DMChannel

Fetch the DM channel for this user.

RETURNS DESCRIPTION
DMChannel

The requested channel.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the user is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> User

Get this user's up-to-date object by performing an API call.

RETURNS DESCRIPTION
User

The requested user object.

RAISES DESCRIPTION
NotFoundError

If the user is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

send async #

Send a message to this user in DM's.

PARAMETER DESCRIPTION
content

If provided, the message contents. If hikari.undefined.UNDEFINED, then nothing will be sent in the content. Any other value here will be cast to a str.

If this is a hikari.embeds.Embed and no embed nor embeds kwarg is provided, then this will instead update the embed. This allows for simpler syntax when sending an embed alone.

Likewise, if this is a hikari.files.Resource, then the content is instead treated as an attachment if no attachment and no attachments kwargs are provided.

TYPE: UndefinedOr[Any] DEFAULT: UNDEFINED

attachment

If provided, the message attachment. This can be a resource, or string of a path on your computer or a URL.

Attachments can be passed as many different things, to aid in convenience.

TYPE: UndefinedOr[Resourceish] DEFAULT: UNDEFINED

attachments

If provided, the message attachments. These can be resources, or strings consisting of paths on your computer or URLs.

TYPE: UndefinedOr[Sequence[Resourceish]] DEFAULT: UNDEFINED

component

If provided, builder object of the component to include in this message.

TYPE: UndefinedOr[ComponentBuilder] DEFAULT: UNDEFINED

components

If provided, a sequence of the component builder objects to include in this message.

TYPE: UndefinedOr[Sequence[ComponentBuilder]] DEFAULT: UNDEFINED

embed

If provided, the message embed.

TYPE: UndefinedOr[Embed] DEFAULT: UNDEFINED

embeds

If provided, the message embeds.

TYPE: UndefinedOr[Sequence[Embed]] DEFAULT: UNDEFINED

tts

If provided, whether the message will be read out by a screen reader using Discord's TTS (text-to-speech) system.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

reply

If provided, the message to reply to.

TYPE: UndefinedOr[SnowflakeishOr[PartialMessage]] DEFAULT: UNDEFINED

reply_must_exist

If provided, whether to error if the message being replied to does not exist instead of sending as a normal (non-reply) message.

This will not do anything if not being used with reply.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

mentions_everyone

If provided, whether the message should parse @everyone/@here mentions.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

mentions_reply

If provided, whether to mention the author of the message that is being replied to.

This will not do anything if not being used with reply.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

user_mentions

If provided, and True, all user mentions will be detected. If provided, and False, all user mentions will be ignored if appearing in the message body. Alternatively this may be a collection of hikari.snowflakes.Snowflake, or hikari.users.PartialUser derivatives to enforce mentioning specific users.

TYPE: UndefinedOr[SnowflakeishSequence[PartialUser] | bool] DEFAULT: UNDEFINED

role_mentions

If provided, and True, all role mentions will be detected. If provided, and False, all role mentions will be ignored if appearing in the message body. Alternatively this may be a collection of hikari.snowflakes.Snowflake, or hikari.guilds.PartialRole derivatives to enforce mentioning specific roles.

TYPE: UndefinedOr[SnowflakeishSequence[PartialRole] | bool] DEFAULT: UNDEFINED

flags

If provided, optional flags to set on the message. If hikari.undefined.UNDEFINED, then nothing is changed.

Note that some flags may not be able to be set. Currently the only flags that can be set are hikari.messages.MessageFlag.NONE and hikari.messages.MessageFlag.SUPPRESS_EMBEDS.

TYPE: UndefinedType | int | MessageFlag DEFAULT: UNDEFINED

RETURNS DESCRIPTION
Message

The created message.

RAISES DESCRIPTION
ValueError

If more than 100 unique objects/entities are passed for role_mentions or user_mentions.

TypeError

If both attachment and attachments are specified.

BadRequestError

This may be raised in several discrete situations, such as messages being empty with no attachments or embeds; messages with more than 2000 characters in them, embeds that exceed one of the many embed limits; too many attachments; attachments that are too large; invalid image URLs in embeds; reply not found or not in the same channel; too many components.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.SEND_MESSAGES in the channel or the person you are trying to message has the DM's disabled.

NotFoundError

If the user is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

PartialUserImpl #

Bases: PartialUser

Implementation for partial information about a user.

This is pretty much the same as a normal user, but information may not be present, which will be denoted by hikari.undefined.UNDEFINED.

accent_color class-attribute instance-attribute #

accent_color: UndefinedNoneOr[Color] = field(
    eq=False, hash=False, repr=False
)

The custom banner color for the user, if set.

The official client will decide the default color if not set.

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False,
    eq=False,
    hash=False,
    metadata={SKIP_DEEP_COPY: True},
)

Client application that models may use for procedures.

avatar_decoration class-attribute instance-attribute #

avatar_decoration: UndefinedNoneOr[AvatarDecoration] = (
    field(eq=False, hash=False, repr=False)
)

Avatar decoration of the user, if an avatar decoration is set.

avatar_hash class-attribute instance-attribute #

avatar_hash: UndefinedNoneOr[str] = field(
    eq=False, hash=False, repr=False
)

Avatar hash of the user, if a custom avatar is set.

banner_hash class-attribute instance-attribute #

banner_hash: UndefinedNoneOr[str] = field(
    eq=False, hash=False, repr=False
)

Banner hash of the user, if a custom banner is set.

discriminator class-attribute instance-attribute #

discriminator: UndefinedOr[str] = field(
    eq=False, hash=False, repr=True
)

Four-digit discriminator for the user if unmigrated.

!!! deprecated 2.0.0.dev120 Discriminators are deprecated and being replaced with "0" by Discord during username migration. This field will be removed after migration is complete. Learn more here: https://dis.gd/usernames

flags class-attribute instance-attribute #

flags: UndefinedOr[UserFlag] = field(
    eq=False, hash=False, repr=True
)

Public flags for this user.

global_name class-attribute instance-attribute #

global_name: UndefinedNoneOr[str] = field(
    eq=False, hash=False, repr=True
)

Global name of the user.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this user.

is_bot class-attribute instance-attribute #

is_bot: UndefinedOr[bool] = field(
    eq=False, hash=False, repr=True
)

Whether this user is a bot account.

is_system class-attribute instance-attribute #

is_system: UndefinedOr[bool] = field(
    eq=False, hash=False, repr=True
)

Whether this user is a system account.

mention property #

mention: str

Return a raw mention string for the given user.

Examples:

>>> some_user.mention
'<@123456789123456789>'

username class-attribute instance-attribute #

username: UndefinedOr[str] = field(
    eq=False, hash=False, repr=True
)

Username of the user.

PremiumType #

Bases: int, Enum

The types of Nitro.

NITRO class-attribute instance-attribute #

NITRO = 2

Premium tier including all available perks (e.g. 2 server boosts).

NITRO_BASIC class-attribute instance-attribute #

NITRO_BASIC = 3

Premium tier including basic perks (e.g. animated emojis and avatars).

NITRO_CLASSIC class-attribute instance-attribute #

NITRO_CLASSIC = 1

Legacy premium tier, including basic perks like animated emojis and avatars.

NONE class-attribute instance-attribute #

NONE = 0

No premium.

User #

Bases: PartialUser, ABC

Interface for any user-like object.

This does not include partial users, as they may not be fully formed.

accent_color abstractmethod property #

accent_color: Color | None

The custom banner color for the user, if set else None.

The official client will decide the default color if not set.

accent_colour property #

accent_colour: Color | None

Alias for the hikari.users.User.accent_color field.

app abstractmethod property #

app: RESTAware

Client application that models may use for procedures.

avatar_decoration abstractmethod property #

avatar_decoration: AvatarDecoration | None

Avatar decoration for the user, if they have one, otherwise None.

avatar_hash abstractmethod property #

avatar_hash: str | None

Avatar hash for the user, if they have one, otherwise None.

avatar_url property #

avatar_url: URL | None

Avatar URL for the user, if they have one set.

Will be None if no avatar is set. In this case, you should use hikari.User.default_avatar_url instead.

banner_hash abstractmethod property #

banner_hash: str | None

Banner hash for the user, if they have one, otherwise None.

banner_url property #

banner_url: URL | None

Banner URL for the user, if they have one set.

Will be None if no banner is set.

default_avatar_url property #

default_avatar_url: URL

Default avatar URL for this user.

discriminator abstractmethod property #

discriminator: str

Discriminator for the user.

!!! deprecated 2.0.0.dev120 Discriminators are deprecated and being replaced with "0" by Discord during username migration. This field will be removed after migration is complete. Learn more here: https://dis.gd/usernames

display_avatar_decoration property #

display_avatar_decoration: AvatarDecoration | None

Display avatar decoration for the user, if they have one set.

Will be None if no avatar decoration is set.

display_avatar_url property #

display_avatar_url: URL

Display avatar URL for this user.

display_banner_url property #

display_banner_url: URL | None

Display banner URL for this user, if they have one set.

Will be None if no banner is set.

flags abstractmethod property #

flags: UserFlag

Flag bits that are set for the user.

global_name abstractmethod property #

global_name: str | None

Global name for the user, if they have one, otherwise None.

is_bot abstractmethod property #

is_bot: bool

Whether this user is a bot account.

is_system abstractmethod property #

is_system: bool

Whether this user is a system account.

mention abstractmethod property #

mention: str

Return a raw mention string for the given user.

Examples:

>>> some_user.mention
'<@123456789123456789>'

username abstractmethod property #

username: str

Username for the user.

make_avatar_url #

make_avatar_url(
    *,
    file_format: UndefinedOr[
        Literal[
            "PNG", "JPEG", "JPG", "WEBP", "AWEBP", "GIF"
        ]
    ] = UNDEFINED,
    size: int = 4096,
    lossless: bool = True,
    ext: str | None | UndefinedType = UNDEFINED,
) -> URL | None

Generate the avatar URL for this user, if set.

If no avatar is set, this returns None.

PARAMETER DESCRIPTION
file_format

The format to use for this URL.

Supports PNG, JPEG, JPG, WEBP, AWEBP and GIF.

If not specified, the format will be determined based on whether the avatar is animated or not.

TYPE: UndefinedOr[Literal['PNG', 'JPEG', 'JPG', 'WEBP', 'AWEBP', 'GIF']] DEFAULT: UNDEFINED

size

The size to set for the URL; Can be any power of two between 16 and 4096;

TYPE: int DEFAULT: 4096

lossless

Whether to return a lossless or compressed WEBP image; This is ignored if file_format is not WEBP or AWEBP.

TYPE: bool DEFAULT: True

ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the avatar is animated or not.

!!! deprecated 2.4.0 This has been replaced with the file_format argument.

TYPE: str | None | UndefinedType DEFAULT: UNDEFINED

RETURNS DESCRIPTION
Optional[URL]

The URL, or None if no avatar is set.

RAISES DESCRIPTION
TypeError

If an invalid format is passed for file_format; If an animated format is requested for a static avatar.

ValueError

If size is specified but is not a power of two or not between 16 and 4096.

make_banner_url #

make_banner_url(
    *,
    file_format: UndefinedOr[
        Literal[
            "PNG", "JPEG", "JPG", "WEBP", "AWEBP", "GIF"
        ]
    ] = UNDEFINED,
    size: int = 4096,
    lossless: bool = True,
    ext: str | None | UndefinedType = UNDEFINED,
) -> URL | None

Generate the banner URL for this user, if set.

If no banner is set, this returns None.

PARAMETER DESCRIPTION
file_format

The format to use for this URL.

Supports PNG, JPEG, JPG, WEBP, AWEBP and GIF.

If not specified, the format will be determined based on whether the banner is animated or not.

TYPE: UndefinedOr[Literal['PNG', 'JPEG', 'JPG', 'WEBP', 'AWEBP', 'GIF']] DEFAULT: UNDEFINED

size

The size to set for the URL; Can be any power of two between 16 and 4096;

TYPE: int DEFAULT: 4096

lossless

Whether to return a lossless or compressed WEBP image; This is ignored if file_format is not WEBP or AWEBP.

TYPE: bool DEFAULT: True

ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the banner is animated or not.

!!! deprecated 2.4.0 This has been replaced with the file_format argument.

TYPE: str | None | UndefinedType DEFAULT: UNDEFINED

RETURNS DESCRIPTION
Optional[URL]

The URL, or None if no banner is set.

RAISES DESCRIPTION
TypeError

If an invalid format is passed for file_format; If an animated format is requested for a static banner.

ValueError

If size is specified but is not a power of two or not between 16 and 4096.

UserFlag #

Bases: Flag

The known user flags that represent account badges.

ACTIVE_DEVELOPER class-attribute instance-attribute #

ACTIVE_DEVELOPER = 1 << 22

Active developer of a Discord app.

BOT_HTTP_INTERACTIONS class-attribute instance-attribute #

BOT_HTTP_INTERACTIONS = 1 << 19

Uses only HTTP interactions and is shown in the active member list.

BUG_HUNTER_LEVEL_1 class-attribute instance-attribute #

BUG_HUNTER_LEVEL_1 = 1 << 3

Participated in the Discord Testers community.

BUG_HUNTER_LEVEL_2 class-attribute instance-attribute #

BUG_HUNTER_LEVEL_2 = 1 << 14

Vastly participated in the Discord Testers community.

COLLABORATOR class-attribute instance-attribute #

COLLABORATOR = 1 << 50

Discord Collaborator, considered Staff.

DISCORD_CERTIFIED_MODERATOR class-attribute instance-attribute #

DISCORD_CERTIFIED_MODERATOR = 1 << 18

Alumni of the moderator program.

DISCORD_EMPLOYEE class-attribute instance-attribute #

DISCORD_EMPLOYEE = 1 << 0

Discord Employee.

EARLY_SUPPORTER class-attribute instance-attribute #

EARLY_SUPPORTER = 1 << 9

Early premium supporter of Discord.

EARLY_VERIFIED_DEVELOPER class-attribute instance-attribute #

EARLY_VERIFIED_DEVELOPER = 1 << 17

Early verified bot developer.

HYPESQUAD_BALANCE class-attribute instance-attribute #

HYPESQUAD_BALANCE = 1 << 8

Member of the HypeSquad House of Balance.

HYPESQUAD_BRAVERY class-attribute instance-attribute #

HYPESQUAD_BRAVERY = 1 << 6

Member of the HypeSquad House of Bravery.

HYPESQUAD_BRILLIANCE class-attribute instance-attribute #

HYPESQUAD_BRILLIANCE = 1 << 7

Member of the HypeSquad House of Brilliance.

HYPESQUAD_EVENTS class-attribute instance-attribute #

HYPESQUAD_EVENTS = 1 << 2

Participated in HypeSquad Events.

NONE class-attribute instance-attribute #

NONE = 0

None.

PARTNERED_SERVER_OWNER class-attribute instance-attribute #

PARTNERED_SERVER_OWNER = 1 << 1

Partnered Discord server owner.

PROVISIONAL_ACCOUNT class-attribute instance-attribute #

PROVISIONAL_ACCOUNT = 1 << 23

Provisional account used with the social layer integration.

QUARANTINED class-attribute instance-attribute #

QUARANTINED = 1 << 44

Account is quarantined.

RESTRICTED_COLLABORATOR class-attribute instance-attribute #

RESTRICTED_COLLABORATOR = 1 << 51

Restricted Discord Collaborator, considered Staff.

SPAMMER class-attribute instance-attribute #

SPAMMER = 1 << 20

Suspected of being a spammer.

TEAM_USER class-attribute instance-attribute #

TEAM_USER = 1 << 10

Pseudo-user for an app's development team.

VERIFIED_BOT class-attribute instance-attribute #

VERIFIED_BOT = 1 << 16

Verified bot.

UserImpl #

Bases: PartialUserImpl, User

Concrete implementation of user information.

accent_color class-attribute instance-attribute #

accent_color: Color | None = field(
    eq=False, hash=False, repr=False
)

The custom banner color for the user, if set.

The official client will decide the default color if not set.

avatar_decoration class-attribute instance-attribute #

avatar_decoration: AvatarDecoration | None = field(
    eq=False, hash=False, repr=False
)

Avatar decoration of the user, if they have one.

avatar_hash class-attribute instance-attribute #

avatar_hash: str | None = field(
    eq=False, hash=False, repr=False
)

The user's avatar hash, if they have one, otherwise None.

banner_hash class-attribute instance-attribute #

banner_hash: str | None = field(
    eq=False, hash=False, repr=False
)

Banner hash of the user, if they have one, otherwise None

discriminator class-attribute instance-attribute #

discriminator: str = field(eq=False, hash=False, repr=True)

The user's discriminator.

!!! deprecated 2.0.0.dev120 Discriminators are deprecated and being replaced with "0" by Discord during username migration. This field will be removed after migration is complete. Learn more here: https://dis.gd/usernames

flags class-attribute instance-attribute #

flags: UserFlag = field(eq=False, hash=False, repr=True)

The public flags for this user.

global_name class-attribute instance-attribute #

global_name: str | None = field(
    eq=False, hash=False, repr=True
)

The user's global name.

is_bot class-attribute instance-attribute #

is_bot: bool = field(eq=False, hash=False, repr=True)

True if this user is a bot account, False otherwise.

is_system class-attribute instance-attribute #

is_system: bool = field(eq=False, hash=False, repr=True)

True if this user is a system account, False otherwise.

username class-attribute instance-attribute #

username: str = field(eq=False, hash=False, repr=True)

The user's username.