Skip to main content

Forward message

Forwards an existing message to the current dialog box

Function ForwardMessage(Val Token, Val MessageID, Val FromChatID, Val ChatID, Val Text = "") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringBot token
MessageID--messageidString, NumberOriginal message ID
FromChatID--fromidString, NumberSource chat ID
ChatID--chatidString, NumberChat ID for message sending
Text--textStringAdditional message text

Returns: Map Of KeyAndValue - serialized JSON response from VK Teams


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


1C:Enterprise/OneScript code example
    Token      = "001.3501506236.091...";
ChatID = "AoLI0egLWBSLR1Ngn2w";
FromChatID = "689203963@chat.agent";
MessageID = "7428324441567793059";

Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID);

Text = "Additional text";

Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID, Text);
    oint vkteams ForwardMessage \
--token "***" \
--messageid "7431934219846160783" \
--fromid "689203963@chat.agent" \
--chatid "AoLI0egLWBSLR1Ngn2w" \
--text "Additional text"
Result
{
"msgId": "7423657667542911288",
"ok": true
}