---
sidebar_position: 11
description: Forward message and other functions to work with Telegram in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Forward message
 Forwards a message between chats or within a chat



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

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | OriginalID | --message | String, Number | &#x2714; | Original message ID |
  | FromID | --from | String, Number | &#x2714; | Chat ID of the original message |
  | ToID | --to | String, Number | &#x2714; | Target chat ID or ChatID*TopicID |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Telegram

:::tip
Method at API documentation: [forwardMessage](https://core.telegram.org/bots/api#forwardmessage)
:::
<br/>


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

    Result = OPI_Telegram.ForwardMessage(Token, MessageID, ChannelID, ChatID);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint telegram ForwardMessage \
             --token "***" \
             --message "23486" \
             --from "@testsichee" \
             --to "461699897"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint telegram ForwardMessage ^
             --token "***" ^
             --message "23486" ^
             --from "@testsichee" ^
             --to "461699897"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "ok": true,
 "result": {
  "message_id": 18416,
  "from": {
   "id": 6129457865,
   "is_bot": true,
   "first_name": "Бот Виталий",
   "username": "sicheebot"
  },
  "chat": {
   "id": 461699897,
   "first_name": "Anton",
   "last_name": "Titovets",
   "username": "bayselonarrend",
   "type": "private"
  },
  "date": 1765390564,
  "forward_origin": {
   "type": "channel",
   "chat": {
    "id": -1001893407333,
    "title": "Тестовый канал",
    "username": "testsichee",
    "type": "channel"
   },
   "message_id": 23486,
   "date": 1765390284
  },
  "forward_from_chat": {
   "id": -1001893407333,
   "title": "Тестовый канал",
   "username": "testsichee",
   "type": "channel"
  },
  "forward_from_message_id": 23486,
  "forward_date": 1765390284,
  "text": "Bold text",
  "entities": [
   {
    "offset": 0,
    "length": 9,
    "type": "bold"
   }
  ]
 }
}
```
