Skip to main content

Send contact

Sends a contact with name and phone number

Function SendContact(Val Token, Val ChatID, Val Name, Val LastName, Val Phone, Val Keyboard = "") Export

ParameterCLI optionTypeDescription
Token--tokenStringBot token
ChatID--chatString, NumberTarget chat ID or ChatID*TopicID
Name--nameStringContact name
LastName--surnameStringContact last name
Phone--phoneStringContact phone number
Keyboard--keyboardStringKeyboard JSON or path to .json

Returns: Map Of KeyAndValue - Serialized JSON response from Telegram


Code example
    Token     = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
ChannelID = "@testsichee";
Name = "Петр";
LastName = "Петров";
Phone = "88005553535";

Result = OPI_Telegram.SendContact(Token, ChatID , Name, LastName, Phone);

Result = OPI_Telegram.SendContact(Token, ChannelID, Name, LastName, Phone);
CLI command example
    
oint telegram SendContact --token "6129457865:AAFyzNYOAFbu..." --chat "461699897" --name "John" --surname "Doe" --phone "88005553535" --keyboard %keyboard%

Result
{
"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"
}
}
}