mirror of
https://github.com/danog/MadelineProto.git
synced 2024-12-15 12:26:55 +01:00
48 lines
1.0 KiB
Markdown
48 lines
1.0 KiB
Markdown
---
|
|
title: contact
|
|
description: Describes user contact
|
|
---
|
|
## Constructor: contact
|
|
[Back to constructors index](index.md)
|
|
|
|
|
|
|
|
Describes user contact
|
|
|
|
### Attributes:
|
|
|
|
| Name | Type | Required | Description |
|
|
|----------|:-------------:|:--------:|------------:|
|
|
|phone\_number|[string](../types/string.md) | Yes|User's phone number|
|
|
|first\_name|[string](../types/string.md) | Yes|User first name, 1-255 characters|
|
|
|last\_name|[string](../types/string.md) | Yes|User last name|
|
|
|user\_id|[int](../types/int.md) | Yes|User identifier if known, 0 otherwise|
|
|
|
|
|
|
|
|
### Type: [Contact](../types/Contact.md)
|
|
|
|
|
|
### Example:
|
|
|
|
```
|
|
$contact = ['_' => 'contact', 'phone_number' => string, 'first_name' => string, 'last_name' => string, 'user_id' => int, ];
|
|
```
|
|
|
|
[PWRTelegram](https://pwrtelegram.xyz) json-encoded version:
|
|
|
|
```
|
|
{"_":"contact","phone_number":"string","first_name":"string","last_name":"string","user_id":"int"}
|
|
```
|
|
|
|
|
|
Or, if you're into Lua:
|
|
|
|
|
|
```
|
|
contact={_='contact', phone_number=string, first_name=string, last_name=string, user_id=int, }
|
|
|
|
```
|
|
|
|
|