addContact - libtd-ktx

Kotlin Coroutines extensions for Telegram API TDLib (Telegram Database library)


libtd-ktx / kotlinx.telegram.coroutines / addContact

addContact

suspend fun TelegramFlow.addContact(contact: Contact?, sharePhoneNumber: Boolean): Unit

Suspend function, which adds a user to the contact list or edits an existing contact by their user identifier.

Parameters

contact - The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored.

sharePhoneNumber - True, if the new contact needs to be allowed to see current user’s phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field UserFullInfo.needPhoneNumberPrivacyException to check whether the current user needs to be asked to share their phone number.