Methods

sendContact

Send a contact.

Parameters

chatId: ID

The identifier of a chat to send the contact to.

firstName: string

The contact’s first name.

phoneNumber: string

The contact’s phone number.

lastName?: string

The contact’s last name.

vcard?: string

Additional information in the vCard format.

isSilent?: boolean

Whether to send the message in a silent way without making a sound on the recipients’ clients.

isContentProtected?: boolean

Whether to protect the contents of the message from copying and forwarding.

replyTo?: ReplyTo

Information on what the message is replying to.

messageThreadId?: number

The identifier of a thread to send the message to.

directMessagesTopicId?: number

The identifier of the direct messages topic that is being replied to.

sendAs?: ID

The identifier of a chat to send the message on behalf of. User-only.

effectId?: string

The identifier of a message effect to be attached to the message.

sendAt?: number

If specified, the message will be scheduled to be sent at that date. User-only.

receiverId?: ID

The identifier of the user that will receive the ephemeral message.

callbackQueryId?: string

The identifier of the callback query that triggered the ephemeral message.

businessConnectionId?: string

The identifier of a business connection to perform the action on. Bot-only.

isPaidBroadcast?: boolean

Whether the message is a broadcast that is going to be paid for. Bot-only.

replyMarkup?: ReplyMarkup

The reply markup of the message. Bot-only.

Result

The sent contact.

Syntax

// Required parameters only.
await client.sendContact(chatId, firstName, phoneNumber);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.sendContact(chatId, firstName, phoneNumber, {
    lastName,
    vcard,
    isSilent,
    isContentProtected,
    replyTo,
    messageThreadId,
    directMessagesTopicId,
    sendAs,
    effectId,
    sendAt,
    receiverId,
    callbackQueryId,
    businessConnectionId,
    isPaidBroadcast,
    replyMarkup,
});