2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 9
|
|
|
|
---
|
|
|
|
|
|
|
|
# Send contact
|
|
|
|
Sends a contact with name and phone number
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function SendContact(Val Token, Val ChatID, Val Name, Val LastName, Val Phone, Val Keyboard = "") Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Bot token |
|
|
|
|
| ChatID | --chat | String, Number | Target chat ID or ChatID*TopicID |
|
|
|
|
| Name | --name | String | Contact name |
|
|
|
|
| LastName | --surname | String | Contact last name |
|
|
|
|
| Phone | --phone | String | Contact phone number |
|
|
|
|
| Keyboard | --keyboard | String | Keyboard JSON or path to .json |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Telegram
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-07-10 13:24:11 +02:00
|
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
2024-06-05 12:19:46 +02:00
|
|
|
ChatID = "461699897";
|
2024-06-09 01:26:57 +02:00
|
|
|
ChannelID = "@testsichee";
|
2024-06-05 12:19:46 +02:00
|
|
|
Name = "John";
|
|
|
|
LastName = "Doe";
|
|
|
|
Phone = "88005553535";
|
|
|
|
|
|
|
|
Result = OPI_Telegram.SendContact(Token, ChatID, Name, LastName, Phone);
|
2024-07-31 20:55:27 +02:00
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
Result = OPI_Telegram.SendContact(Token, ChannelID, Name, LastName, Phone);
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint telegram SendContact --token "6129457865:AAFyzNYOAFbu..." --chat "461699897" --name "John" --surname "Doe" --phone "88005553535" --keyboard %keyboard%
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"ok": true,
|
|
|
|
"result": {
|
|
|
|
"message_id": 4647,
|
|
|
|
"from": {
|
|
|
|
"id": 6129457865,
|
|
|
|
"is_bot": true,
|
|
|
|
"first_name": "Vitaly The Bot",
|
|
|
|
"username": "sicheebot"
|
|
|
|
},
|
|
|
|
"chat": {
|
|
|
|
"id": 461699897,
|
|
|
|
"first_name": "Anton",
|
|
|
|
"last_name": "Titowets",
|
|
|
|
"username": "JKIee",
|
|
|
|
"type": "private"
|
|
|
|
},
|
|
|
|
"date": 1717072448,
|
|
|
|
"contact": {
|
|
|
|
"phone_number": "88005553535",
|
|
|
|
"first_name": "John",
|
|
|
|
"last_name": "Doe"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|