contacts.AddContact
- class pyrogram.raw.functions.contacts.AddContact
Add an existing telegram user as contact.
- Details:
Layer:
223ID:
D9BA2E54
- Parameters:
id (
InputUser) – Telegram ID of the other userfirst_name (
str) – First namelast_name (
str) – Last namephone (
str) – User’s phone number, may be omitted to simply add the user to the contact list, without a phone number.add_phone_privacy_exception (
bool, optional) – Allow the other user to see our phone number?note (
TextWithEntities, optional)
- Returns:
TL Schema
contacts.addContact#d9ba2e54
flags:#
add_phone_privacy_exception:flags.0?true
id:InputUser
first_name:string
last_name:string
phone:string
note:flags.1?TextWithEntities
= Updates
Parameter Tree
AddContact
├── add_phone_privacy_exception →
true (optional)├── id →
InputUser│ ├──
InputUserEmpty│ ├──
InputUserSelf│ ├──
InputUser│ │ ├── user_id →
long│ │ └── access_hash →
long│ └──
InputUserFromMessage│ ├── peer →
InputPeer│ │ ├──
InputPeerEmpty│ │ ├──
InputPeerSelf│ │ ├──
InputPeerChat│ │ ├──
InputPeerUser│ │ ├──
InputPeerChannel│ │ ├──
InputPeerUserFromMessage│ │ └──
InputPeerChannelFromMessage│ ├── msg_id →
int│ └── user_id →
long├── first_name →
string├── last_name →
string├── phone →
string└── note →
TextWithEntities (optional)└──
TextWithEntities├── text →
string└── entities →
Vector < MessageEntity >│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int├──
MessageEntityUrl│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int├──
MessageEntityPre│ ├── offset →
int│ ├── length →
int│ └── language →
string│ ├── offset →
int│ ├── length →
int│ └── url →
string│ ├── offset →
int│ ├── length →
int│ └── user_id →
long│ ├── offset →
int│ ├── length →
int│ └── user_id →
InputUser│ ├──
InputUserEmpty│ ├──
InputUserSelf│ ├──
InputUser│ └──
InputUserFromMessage│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ └── length →
int│ ├── offset →
int│ ├── length →
int│ └── document_id →
long│ ├── collapsed →
true (optional)│ ├── offset →
int│ └── length →
int├── relative →
true (optional)├── short_time →
true (optional)├── long_time →
true (optional)├── short_date →
true (optional)├── long_date →
true (optional)├── day_of_week →
true (optional)├── offset →
int├── length →
int└── date →
intExample
await app.invoke(
AddContact(
add_phone_privacy_exception=None,
id=await app.resolve_user(chat_id),
first_name="text",
last_name="text",
phone="+1234567890",
note=TextWithEntities(
text="Open",
entities=[
MessageEntityUnknown(
offset=0,
length=0
)
]
),
)
)