Skip to content

sendContact

Sahri Riza Umami edited this page Jun 22, 2018 · 4 revisions

Send a message containing a user contact.

sendContact(chat_id, reply_to_message_id, phone_number, first_name, last_name, user_id, disable_notification, from_background, reply_markup)
Field Type Description
chat_id int53 Target chat.
reply_to_message_id int53 Identifier of the message to reply to.
phone_number string Phone number of the user.
first_name string First name of the user; 1-255 characters in length.
last_name string Last name of the user
user_id int32 Identifier of the user, if known; otherwise 0.
disable_notification Bool Pass true to disable notification for the message. Not supported in secret chats.
from_background Bool Pass true if the message is sent from the background.
reply_markup ReplyMarkup Markup for replying to the message; for bots only.

Example

  • Send a message to chat 1234567890 containing Si Anu contact by his phone number.

    sendContact(1234567890, 0, '621234567890', 'Si', 'Anu')

    Response:

    {
      ["@type"] = "message",
      author_signature = "",
      can_be_deleted_for_all_users = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = false,
      can_be_forwarded = true,
      chat_id = "1234567890",
      contains_unread_mention = false,
      content = {
        ["@type"] = "messageContact",
        contact = {
          ["@type"] = "contact",
          first_name = "Si",
          last_name = "Anu",
          phone_number = "621234567890",
          user_id = 0
        }
      },
      date = 1529659224,
      edit_date = 0,
      id = "16068378633",
      is_channel_post = false,
      is_outgoing = true,
      media_album_id = "0",
      reply_to_message_id = 0,
      sender_user_id = 55555555,
      sending_state = {
        ["@type"] = "messageSendingStatePending"
      },
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 0,
      views = 0
    }

Frequently Asked Questions
The Functions

Clone this wiki locally