2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 11
|
|
|
|
---
|
|
|
|
|
|
|
|
# Forward message
|
|
|
|
Forwards a message between chats or within a chat
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function ForwardMessage(Val Token, Val OriginalID, Val FromID, Val ToID) Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Bot token |
|
|
|
|
| OriginalID | --message | String, Number | Original message ID |
|
|
|
|
| FromID | --from | String, Number | Chat ID of the original message |
|
|
|
|
| ToID | --to | String, Number | Target chat ID or ChatID*TopicID |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Telegram
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-07-10 13:24:11 +02:00
|
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
2024-06-05 12:19:46 +02:00
|
|
|
ChatID = "461699897";
|
|
|
|
ChannelID = "@testsichee";
|
|
|
|
MessageID = "4951";
|
|
|
|
|
|
|
|
Result = OPI_Telegram.ForwardMessage(Token, MessageID, ChannelID, ChatID);
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint telegram ForwardMessage --token "6129457865:AAFyzNYOAFbu..." --message %message% --from %from% --to %to%
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"ok": true,
|
|
|
|
"result": {
|
|
|
|
"message_id": 4649,
|
|
|
|
"from": {
|
|
|
|
"id": 6129457865,
|
|
|
|
"is_bot": true,
|
|
|
|
"first_name": "Vitaly The Bot",
|
|
|
|
"username": "sicheebot"
|
|
|
|
},
|
|
|
|
"chat": {
|
|
|
|
"id": 461699897,
|
|
|
|
"first_name": "Anton",
|
|
|
|
"last_name": "Titowets",
|
|
|
|
"username": "JKIee",
|
|
|
|
"type": "private"
|
|
|
|
},
|
|
|
|
"date": 1717072482,
|
|
|
|
"forward_origin": {
|
|
|
|
"type": "channel",
|
|
|
|
"chat": {
|
|
|
|
"id": -1001893407333,
|
|
|
|
"title": "Test channel",
|
|
|
|
"username": "testsichee",
|
|
|
|
"type": "channel"
|
|
|
|
},
|
|
|
|
"message_id": 4686,
|
|
|
|
"date": 1717072354
|
|
|
|
},
|
|
|
|
"forward_from_chat": {
|
|
|
|
"id": -1001893407333,
|
|
|
|
"title": "Test channel",
|
|
|
|
"username": "testsichee",
|
|
|
|
"type": "channel"
|
|
|
|
},
|
|
|
|
"forward_from_message_id": 4686,
|
|
|
|
"forward_date": 1717072354,
|
|
|
|
"text": "String value"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|