peyk.platforms.telegram.types.contact

Classes

Contact(phone_number, first_name[, ...])

This object represents a phone contact.

class peyk.platforms.telegram.types.contact.Contact(phone_number: str, first_name: str, last_name: str | None = None, user_id: int | None = None, vcard: str | None = None)[source]

Bases: object

This object represents a phone contact.

Variables:
  • phone_number (str) – Contact’s phone number

  • first_name (str) – Contact’s first name

  • last_name (str | None) – Contact’s last name

  • user_id (int | None) – Contact’s user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

  • vcard (str | None) – Additional data about the contact in the form of a vCard

phone_number: str
first_name: str
last_name: str | None = None
user_id: int | None = None
vcard: str | None = None
classmethod from_dict(data: dict | None) Contact | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.