User

discord_http.user module

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.User(*, state, data)

Bases: PartialUser

Parameters:
property display_avatar: Asset

Returns the display avatar of the member.

property display_name: str

Returns the user’s display name.

property global_avatar: Asset | None

Alias for User.avatar.

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

Bases: User

Parameters:
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