User Models#

class interactions.api.models.user.User(kwargs_dict=None, /, **other_kwargs)[स्रोत]#

A class object representing a user.

चर पद :
  • id (Snowflake) -- The User ID

  • username (str) -- The Username associated (not necessarily unique across the platform)

  • discriminator (str) -- The User's 4-digit discord-tag (i.e.: XXXX)

  • avatar (Optional[str]) -- The user's avatar hash, if any

  • bot (Optional[bool]) -- A status denoting if the user is a bot

  • system (Optional[bool]) -- A status denoting if the user is an Official Discord System user

  • mfa_enabled (Optional[bool]) -- A status denoting if the user has 2fa on their account

  • banner (Optional[str]) -- The user's banner hash, if any

  • banner_color (Optional[str]) -- The user's banner color as a hex, if any

  • accent_color (Optional[int]) -- The user's banner color as an integer represented of hex color codes

  • locale (Optional[str]) -- The user's chosen language option

  • verified (Optional[bool]) -- Whether the email associated with this account has been verified

  • email (Optional[str]) -- The user's email, if any

  • flags (Optional[UserFlags]) -- The user's flags

  • premium_type (Optional[int]) -- The type of Nitro subscription the user has

  • public_flags (Optional[UserFlags]) -- The user's public flags

has_public_flag(flag)[स्रोत]#

संस्करण 4.3.0 से नया .

Returns whether the user has public flag.

प्रदत्त प्रकार :

bool

property mention: str#

संस्करण 4.1.0 से नया .

Returns a string that allows you to mention the given user.

प्रदत्त :

The string of the mentioned user.

प्रदत्त प्रकार :

str

property avatar_url: str#

संस्करण 4.2.0 से नया .

Returns the URL of the user's avatar

प्रदत्त :

URL of the user's avatar.

प्रदत्त प्रकार :

str

property banner_url: str | None#

संस्करण 4.2.0 से नया .

Returns the URL of the user's banner.

प्रदत्त :

URL of the user's banner (None will be returned if no banner is set)

प्रदत्त प्रकार :

str

property presence: Presence | None#

संस्करण 4.3.2 से नया .

Returns the presence of the user.

प्रदत्त :

Presence of the user (None will be returned if not cached)

प्रदत्त प्रकार :

Optional[Presence]

property created_at: datetime#

संस्करण 4.4.0 से नया .

Returns when the user was created.

async send(content=<interactions.MISSING>, *, components=<interactions.MISSING>, tts=<interactions.MISSING>, attachments=<interactions.MISSING>, files=<interactions.MISSING>, embeds=<interactions.MISSING>, allowed_mentions=<interactions.MISSING>)[स्रोत]#

संस्करण 4.3.2 से नया .

Sends a DM to the user.

मापदण्ड:
  • content (Optional[str]) -- The contents of the message as a string or string-converted value.

  • components (Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]]) -- A component, or list of components for the message.

  • tts (Optional[bool]) -- Whether the message utilizes the text-to-speech Discord programme or not.

  • attachments (Optional[List[Attachment]]) -- The attachments to attach to the message. Needs to be uploaded to the CDN first

  • files (Optional[Union[File, List[File]]]) -- A file or list of files to be attached to the message.

  • embeds (Optional[Union[Embed, List[Embed]]]) -- An embed, or list of embeds for the message.

  • allowed_mentions (Optional[Union[AllowedMentions, dict]]) -- The allowed mentions for the message.

प्रदत्त :

The sent message as an object.

प्रदत्त प्रकार :

Message

async get_dm_channel()[स्रोत]#

संस्करण 4.4.0 से नया .

Gets the DM channel with the user

प्रदत्त :

The DM channel with the user

प्रदत्त प्रकार :

Channel