Skip to main content

Forward message

Forwards a message between chats or within a chat

Function ForwardMessage(Val Token, Val OriginalID, Val FromID, Val ToID) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringBot token
OriginalID--messageString, NumberOriginal message ID
FromID--fromString, NumberChat ID of the original message
ToID--toString, NumberTarget chat ID or ChatID*TopicID

Returns: Map Of KeyAndValue - serialized JSON response from Telegram


tip

Method at API documentation: forwardMessage


1C:Enterprise/OneScript code example
    Token     = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
ChannelID = "@testsichee";
MessageID = "10111";

Result = OPI_Telegram.ForwardMessage(Token, MessageID, ChannelID, ChatID);
    oint telegram ForwardMessage \
--token "***" \
--from "@testsichee" \
--to "461699897" \
--message "10481"
Result
{
"ok": true,
"result": {
"message_id": 8315,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titowets",
"username": "JKIee",
"type": "private"
},
"date": 1728453470,
"forward_origin": {
"type": "channel",
"chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
"message_id": 9440,
"date": 1728453289
},
"forward_from_chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
"forward_from_message_id": 9440,
"forward_date": 1728453289,
"text": "Строковое значение"
}
}