Melisa Models User#

User#

PremiumTypes#

class PremiumTypes[source]#

Bases: IntEnum

Premium types denote the level of premium a user has.

NITRO#

Full nitro

NITRO_CLASSIC#

Nitro (not boost)

NONE#

There is no subscription Discord Nitro(Full or classic)

UserFlags#

class UserFlags[source]#

Bases: IntEnum

Profile Icons

NONE#

None

STAFF#

Discord Employee

PARTNER#

Partnered Server Owner

HYPESQUAD#

HypeSquad Events Coordinator

BUG_HUNTER_LEVEL_1#

Bug Hunter Level 1

HYPESQUAD_ONLINE_HOUSE_1#

House Bravery Member

HYPESQUAD_ONLINE_HOUSE_2#

House Brilliance Member

HYPESQUAD_ONLINE_HOUSE_3#

House Balance Member

PREMIUM_EARLY_SUPPORTER#

Early Nitro Supporter

TEAM_PSEUDO_USER#

User is a team

BUG_HUNTER_LEVEL_2#

Bug Hunter Level 2

VERIFIED_BOT#

Verified Bot

VERIFIED_DEVELOPER#

Early Verified Bot Developer

CERTIFIED_MODERATOR#

Discord Certified Moderator

BOT_HTTP_INTERACTIONS#

Bot uses only HTTP interactions and is shown in the online member list

VisibilityTypes#

class VisibilityTypes[source]#

Bases: IntEnum

The type of connection visibility.

None#

invisible to everyone except the user themselves

Everyone#

visible to everyone

User#

class User[source]#

Bases: APIModelBase

User Structure

id#

the user’s id

Type:

Snowflake

username#

the user’s username, not unique across the platform

Type:

str

discriminator#

the user’s 4-digit discord-tag

Type:

int

avatar#

the user’s avatar hash

Type:

Optional[str]

bot#

whether the user belongs to an OAuth2 application

Type:

APINullable[bool]

system#

whether the user is an Official Discord System user (part of the urgent message system)

Type:

APINullable[bool]

mfa_enabled#

whether the user has two factor enabled on their account

Type:

APINullable[bool]

banner#

the user’s banner hash

Type:

APINullable[str]

accent_color#

the user’s banner color encoded as an integer representation of hexadecimal color code

Type:

APINullable[int]

locale#

the user’s chosen language option

Type:

APINullable[str]

verified#

whether the email on this account has been verified

Type:

APINullable[bool]

email#

the user’s email

Type:

APINullable[str]

flags#

the flags on a user’s account

Type:

APINullable[UserFlags]

premium_type#

the type of Nitro subscription on a user’s account

Type:

APINullable[int]

public_flags#

the public flags on a user’s account

Type:

APINullable[int]

premium#

The user their premium type in a usable enum.

Type:

APINullable[PremiumTypes]

avatar_url(*, size=1024, image_format=None)[source]#

Avatar url (from the Discord CDN server)

default_avatar_url()[source]#

Default avatar url (from the Discord CDN server)

classmethod from_dict(data)[source]#

Generate a user from the given data.

Parameters:

data (dict) – The dictionary to convert into a user.

property mention#

The user’s mention string. (<@id>)

Type:

str

to_dict()#

Transform the current object to a dictionary representation. Parameters that start with an underscore are not serialized.