1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-21 01:50:24 +02:00
OpenIntegrations/docs/en/md/VK/Interactive-actions/Write-message.md

48 lines
1.1 KiB
Markdown
Raw Normal View History

---
sidebar_position: 3
---
# Write a message
Write a message to a user in the community's dialog
*Function WriteMessage(Val Text, Val UserID, Val Communitytoken, Val Keyboard = "", Val Parameters = "") Export*
| Parameter | CLI option | Type | Destination |
|-|-|-|-|
| Text | --text | String | Message text |
| UserID | --user | String | Recipient user ID |
| Communitytoken | --ct | String | Community chat bot token, which can be obtained in the settings |
| Keyboard | --keyboard | String | JSON keyboard. See FormKeyboard |
| Parameters | --auth | Structure Of String | Authorization JSON or path to .json |
Returns: Key-Value Pair - Serialized JSON response from VK
```bsl title="Code example"
KТ = "vk1.a.IzbBGUkYUvrNfMt_sknCcC66hyYifL0U1Bb...";
Response = OPI_VK.WriteMessage("I am bot, but you - not >:)", 657811122, KТ,, Parameters);
Response = OPI_Tools.JSONString(Response);
```
```sh title="CLI command example"
oint vk WriteMessage --text %text% --user %user% --ct %ct% --keyboard %keyboard% --auth %auth%
```
```json title="Result"
{
"response": 7
}
```