2024-08-13 12:24:12 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 8
|
|
|
|
---
|
|
|
|
|
|
|
|
# Forward message
|
|
|
|
Forwards an existing message to the current dialog box
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`Function ForwardMessage(Val Token, Val MessageID, Val FromChatID, Val ChatID, Val Text = "") Export`
|
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Bot token |
|
2024-08-18 16:47:59 +02:00
|
|
|
| MessageID | --messageid | String, Number | Original message ID |
|
2024-08-13 14:52:26 +02:00
|
|
|
| FromChatID | --fromid | String, Number | Source chat ID |
|
|
|
|
| ChatID | --chatid | String, Number | Chat ID for message sending |
|
|
|
|
| Text | --text | String | Additional message text |
|
2024-08-13 12:24:12 +02:00
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
|
2024-08-18 16:47:59 +02:00
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from VK Teams
|
2024-08-13 12:24:12 +02:00
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
:::tip
|
|
|
|
Only the chatId from events can be passed to the FromChatID (the code from the chat link is not suitable))
|
|
|
|
|
|
|
|
Method at API documentation: [GET /messages/sendText](https://teams.vk.com/botapi/#/messages/get_messages_sendText)
|
|
|
|
:::
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
```bsl title="Code example"
|
2024-09-24 10:38:18 +02:00
|
|
|
Token = "001.3501506236.091...";
|
|
|
|
ChatID = "AoLI0egLWBSLR1Ngn2w";
|
|
|
|
FromChatID = "689203963@chat.agent";
|
2024-09-29 16:35:23 +02:00
|
|
|
MessageID = "7419291601358293295";
|
2024-08-13 15:47:32 +02:00
|
|
|
|
|
|
|
Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID);
|
|
|
|
|
|
|
|
Text = "Additional text";
|
|
|
|
|
|
|
|
Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID, Text);
|
2024-08-13 12:24:12 +02:00
|
|
|
```
|
2024-08-13 14:52:26 +02:00
|
|
|
|
2024-08-13 12:24:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
oint vkteams ForwardMessage --token "001.3501506236.091..." --message "7402287649739767956" --fromid "689203963@chat.agent" --chatid "AoLI0egLWBSLR1Ngn2w" --text "Additional text"
|
2024-08-13 12:24:12 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
```json title="Result"
|
2024-08-14 08:06:31 +02:00
|
|
|
{
|
|
|
|
"msgId": "7402676060812214488",
|
|
|
|
"ok": true
|
|
|
|
}
|
2024-08-13 14:52:26 +02:00
|
|
|
```
|