User

discord_http.user module

class discord_http.user.AvatarDecoration(state, data)

Bases: Snowflake

Represents an avatar decoration of a user.

Parameters:
sku_id

The ID of the SKU associated with the avatar decoration

Type:

int

asset

The asset of the avatar decoration

Type:

Asset

property shop_url: str

The URL of the avatar decoration asset.

class discord_http.user.Nameplate(state, data)

Bases: object

Represents a nameplate collectible of a user.

Parameters:
sku_id

The ID of the SKU associated with the nameplate

Type:

int

label

The label of the nameplate

Type:

str

palette

The palette of the nameplate

Type:

str

asset

The asset of the nameplate

Type:

Asset

property shop_url: str

The URL of the avatar decoration asset.

class discord_http.user.PartialUser(*, state, id)

Bases: PartialBase

Parameters:
async create_dm() DMChannel

Creates a DM channel with the user.

Return type:

DMChannel

property default_avatar: Asset

Returns the default avatar of the user.

async fetch() User

Fetches the user.

Return type:

User

property mention: str

Returns a string that allows you to mention the user.

async send(content=<MISSING>, *, channel_id=<MISSING>, embed=<MISSING>, embeds=<MISSING>, file=<MISSING>, files=<MISSING>, view=<MISSING>, tts=False, type=4, flags=<MISSING>, allowed_mentions=<MISSING>, delete_after=None) Message

Send a message to the user.

Parameters:
  • content (str | None) – Content of the message

  • channel_id (int | None) – Channel ID to send the message to, if not provided, it will create a DM channel

  • embed (Embed | None) – Embed of the message

  • embeds (list[Embed] | None) – Embeds of the message

  • file (File | None) – File of the message

  • files (list[File] | None) – Files of the message

  • view (View | None) – Components of the message

  • tts (bool | None) – Whether the message should be sent as TTS

  • type (ResponseType | int) – Which type of response should be sent

  • flags (MessageFlags | None) – Flags of the message

  • allowed_mentions (AllowedMentions | None) – Allowed mentions of the message

  • delete_after (float | None) – How long to wait before deleting the message

Return type:

Message

Returns:

The message that was sent

class discord_http.user.PrimaryGuild(state, data)

Bases: object

Represents a primary guild of a user.

This is commonly known as ‘clan’.

Parameters:
guild_id

The ID of the guild

Type:

int

tag

The tag of the guild, if any

Type:

str | None

badge

The badge of the guild, if any

Type:

Asset | None

guild() Guild | PartialGuild | None

Returns the guild object.

Return type:

Guild | PartialGuild | None

class discord_http.user.User(*, state, data)

Bases: PartialUser

Represents a user object.

Parameters:
avatar

The avatar of the user, if any

Type:

Asset | None

banner

The banner of the user, if any

Type:

Asset | None

name

The name of the user

Type:

str

bot

Whether the user is a bot

Type:

bool

system

Whether the user is a system user

Type:

bool

discriminator

The discriminator of the user, if any

Type:

str | None

global_name

The global name of the user, if any

Type:

str | None

accent_colour

The accent colour of the user, if any

Type:

Colour | None

banner_colour

The banner colour of the user, if any

Type:

Colour | None

public_flags

The public flags of the user, if any

Type:

UserFlags | None

avatar_decoration

The avatar decoration of the member, if available.

Type:

AvatarDecoration | None

nameplate

The nameplate of the member, if available.

Type:

Nameplate | None

primary_guild

The primary guild of the user (aka. clan), if any

Type:

PrimaryGuild | None

property display_avatar: Asset

Returns the display avatar of the member.

property display_avatar_decoration: AvatarDecoration | None

An alias to merge with Member.display_avatar_decoration.

property display_banner: Asset | None

An alias to merge with Member.display_banner.

property display_name: str

Returns the user’s display name.

property global_avatar: Asset | None

Alias for User.avatar.

property global_avatar_decoration: AvatarDecoration | None

Alias for User.avatar_decoration.

property global_banner: Asset | None

Alias for User.banner.

class discord_http.user.UserClient(*, state, data)

Bases: User

Represents a user client object.

Parameters:
verified

Whether the user is verified

Type:

bool

async edit(*, username=<MISSING>, avatar=<MISSING>, banner=<MISSING>) UserClient

Edit the user.

Parameters:
  • username (str | None) – The username to change the user to

  • avatar (bytes | None) – New avatar for the user

  • banner (bytes | None) – New banner for the user

Return type:

UserClient

Returns:

The user that was edited