Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# Contact

class telegram.Contact(phone_number, first_name, last_name=None, user_id=None, vcard=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object represents a phone contact.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `phone_number` is equal.

  Parameters:

    - phone_number (`str`) – Contact’s phone number.

    - first_name (`str`) – Contact’s first name.

    - last_name (`str`, optional) – Contact’s last name.

    - user_id (`int`, optional) – Contact’s user identifier in Telegram.

    - vcard (`str`, optional) – Additional data about the contact in the form of a vCard.

  phone_number

    Contact’s phone number.

    Type:

      `str`

  first_name

    Contact’s first name.

    Type:

      `str`

  last_name

    Optional. Contact’s last name.

    Type:

      `str`

  user_id

    Optional. Contact’s user identifier in Telegram.

    Type:

      `int`

  vcard

    Optional. Additional data about the contact in the form of a vCard.

    Type:

      `str`

  Use In

  `telegram.Bot.send_contact()`

  Available In

  - `telegram.ExternalReplyInfo.contact`

  - `telegram.Message.contact`