1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-18 23:48:56 +02:00
OpenIntegrations/docs/en/md/Telegram/Data-sending/Forward-message.md
2024-08-13 15:52:26 +03:00

1.9 KiB

sidebar_position
11

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 Description
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

Returns: Map Of KeyAndValue - Serialized JSON response from Telegram


  Token     = FunctionParameters["Telegram_Token"];
  ChatID    = FunctionParameters["Telegram_ChatID"];
  ChannelID = FunctionParameters["Telegram_ChannelID"];
  MessageID = FunctionParameters["Telegram_ChannelMessageID"];
  
  Result = OPI_Telegram.ForwardMessage(Token, MessageID, ChannelID, ChatID);
    
  oint telegram ForwardMessage --token "6129457865:AAFyzNYOAFbu..." --message %message% --from %from% --to %to%

{
  "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"
  }
  }