MadelineProto/docs/TD_docs/constructors/contact.md

48 lines
1.1 KiB
Markdown
Raw Normal View History

---
title: contact
description: Describes user contact
---
## Constructor: contact
[Back to constructors index](index.md)
Describes user contact
### Attributes:
| Name | Type | Required | Description |
2017-08-20 11:05:56 +02:00
|----------|---------------|----------|-------------|
|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:
```
2017-07-23 16:33:46 +02:00
$contact = ['_' => 'contact', 'phone_number' => 'string', 'first_name' => 'string', 'last_name' => 'string', 'user_id' => int];
```
2017-07-23 16:11:02 +02:00
[PWRTelegram](https://pwrtelegram.xyz) json-encoded version:
```
2017-07-23 16:33:46 +02:00
{"_": "contact", "phone_number": "string", "first_name": "string", "last_name": "string", "user_id": int}
2017-07-23 16:11:02 +02:00
```
Or, if you're into Lua:
```
2017-07-23 16:33:46 +02:00
contact={_='contact', phone_number='string', first_name='string', last_name='string', user_id=int}
```