Add button to forward message from channel in Telegram

Viewed 566

I'm not quite sure it's possible but probably someone did that. Is it possible to use bot for appending button to message user forwarded to bot? I mean:

  1. Admin posted a message in his channel.
  2. Admin forwarded message to bot (assume bot added in channel).
  3. Bot appends to original message in channel with button.
1 Answers

So the answer is yes - it can be done with editMessageReplyMarkup API method:

curl 
  --request POST \
  --url https://api.telegram.org/bot{BOT_SECRET_TOKEN}/editMessageReplyMarkup \
  --header 'Content-Type: application/json' \
  --data '{
    "chat_id": {CHANNEL_ID},
    "message_id": {CHANNEL_MESSAGE_ID},
    "reply_markup": {
        "inline_keyboard": [
            [
                {
                    "text": "Hello world!",
                    "url": "https://google.com"
                }
            ]
        ]
    }
}'
Related