1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/VKTeams/Message-sending/Send-text-message.mdx
T

71 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 1
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Send text message
Sends a text message to a chat
`Function SendTextMessage(Val Token, Val ChatID, Val Text, Val ReplyID = 0, Val Keyboard = "", Val Markup = "MarkdownV2") Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Bot token |
| ChatID | --chatid | String, Number | ✔ | Chat ID for message sending |
| Text | --text | String | ✔ | Message text |
| ReplyID | --reply | String, Number | ✖ | Replying message id if necessary |
| Keyboard | --keyboard | Array Of String | ✖ | Buttons to the message if necessary |
| Markup | --parsemod | String | ✖ | Markup type for message text: MarkdownV2 or HTML |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from VK Teams
<br/>
:::tip
You can mention a user by appending their userId to the text in the following format @[userId]
Method at API documentation: [GET /messages/sendText](https://teams.vk.com/botapi/#/messages/get_messages_sendText)
:::
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
Token = "001.3501506236.091...";
ChatID = "AoLI0egLWBSLR1Ngn2w";
Text = "Message text";
Result = OPI_VKTeams.SendTextMessage(Token, ChatID, Text);
ChatID = "689203963@chat.agent";
2024-10-19 21:23:38 +03:00
ReplyID = "7427552004584508943";
2024-10-15 10:16:04 +03:00
Text = "<b>Bold text</b>";
Markup = "HTML";
Keyboard = New Array;
ButtonsLineArray = New Array;
ButtonsLineArray.Add(OPI_VKTeams.MakeActionButton("Button1", "ButtonEvent1", , "attention"));
ButtonsLineArray.Add(OPI_VKTeams.MakeActionButton("Button2", , "https://openintegrations.dev"));
Keyboard.Add(ButtonsLineArray);
Keyboard.Add(ButtonsLineArray);
Result = OPI_VKTeams.SendTextMessage(Token, ChatID, Text, ReplyID, Keyboard, Markup);
```
```json title="Result"
{
"msgId": "7423657487154285625",
"ok": true
}
```