﻿---
sidebar_position: 11
---

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

<br/>

:::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 = "16274";

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

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


```json title="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": "Строковое значение"
 }
}
```
