addContact

Add a contact. USER-ONLY

Parameters

userId: ID

The identifier of the user to add as contact.

firstName: string

The contact’s first name.

lastName?: string

The contact’s last name.

isPhoneNumberShared?: boolean

Whether the phone number of the current account should be shared with the new contact.

phoneNumber?: string

The contact’s phone number.

note?: string

A note to attach to the contact.

noteEntities?: MessageEntity[]

The note’s entities.

noteParseMode?: ParseMode

The parse mode to use for the note

Result

void

Syntax

// Required parameters only.
await client.addContact(userId, firstName);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.addContact(userId, firstName, {
    lastName,
    isPhoneNumberShared,
    phoneNumber,
    note,
    noteEntities,
    noteParseMode,
});