fix(telegram): use HTTP Request for editMessageText with keyboards
The n8n Telegram node's inlineKeyboard parameter doesn't work reliably with editMessageText operation. Switched to HTTP Request node calling Telegram API directly, which properly passes reply_markup. Changed nodes: - Send Confirmation Dialog - Send Stop Result - Send Expired Message Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+27
-54
@@ -4612,84 +4612,57 @@
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "editMessageText",
|
||||
"messageId": "={{ $json.messageId }}",
|
||||
"chatId": "={{ $json.chatId }}",
|
||||
"text": "={{ $json.text }}",
|
||||
"replyMarkup": "inlineKeyboard",
|
||||
"inlineKeyboard": "={{ JSON.stringify($json.reply_markup.inline_keyboard) }}",
|
||||
"additionalFields": {
|
||||
"parse_mode": "HTML"
|
||||
}
|
||||
"method": "POST",
|
||||
"url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/editMessageText",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "={{ JSON.stringify({ chat_id: $json.chatId, message_id: $json.messageId, text: $json.text, parse_mode: 'HTML', reply_markup: $json.reply_markup }) }}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "http-send-confirm-dialog",
|
||||
"name": "Send Confirmation Dialog",
|
||||
"type": "n8n-nodes-base.telegram",
|
||||
"typeVersion": 1.2,
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [
|
||||
2440,
|
||||
1400
|
||||
],
|
||||
"credentials": {
|
||||
"telegramApi": {
|
||||
"id": "I0xTTiASl7C1NZhJ",
|
||||
"name": "Telegram account"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "editMessageText",
|
||||
"messageId": "={{ $json.messageId }}",
|
||||
"chatId": "={{ $json.chatId }}",
|
||||
"text": "={{ $json.text }}",
|
||||
"replyMarkup": "inlineKeyboard",
|
||||
"inlineKeyboard": "={{ JSON.stringify($json.reply_markup.inline_keyboard) }}",
|
||||
"additionalFields": {
|
||||
"parse_mode": "HTML"
|
||||
}
|
||||
"method": "POST",
|
||||
"url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/editMessageText",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "={{ JSON.stringify({ chat_id: $json.chatId, message_id: $json.messageId, text: $json.text, parse_mode: 'HTML', reply_markup: $json.reply_markup }) }}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "http-send-stop-result",
|
||||
"name": "Send Stop Result",
|
||||
"type": "n8n-nodes-base.telegram",
|
||||
"typeVersion": 1.2,
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [
|
||||
2440,
|
||||
1500
|
||||
],
|
||||
"credentials": {
|
||||
"telegramApi": {
|
||||
"id": "I0xTTiASl7C1NZhJ",
|
||||
"name": "Telegram account"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "editMessageText",
|
||||
"messageId": "={{ $json.messageId }}",
|
||||
"chatId": "={{ $json.chatId }}",
|
||||
"text": "={{ $json.text }}",
|
||||
"replyMarkup": "inlineKeyboard",
|
||||
"inlineKeyboard": "={{ JSON.stringify($json.reply_markup.inline_keyboard) }}",
|
||||
"additionalFields": {
|
||||
"parse_mode": "HTML"
|
||||
}
|
||||
"method": "POST",
|
||||
"url": "=https://api.telegram.org/bot{{ $env.TELEGRAM_BOT_TOKEN }}/editMessageText",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "={{ JSON.stringify({ chat_id: $json.chatId, message_id: $json.messageId, text: $json.text, parse_mode: 'HTML', reply_markup: $json.reply_markup }) }}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "http-send-expired-msg",
|
||||
"name": "Send Expired Message",
|
||||
"type": "n8n-nodes-base.telegram",
|
||||
"typeVersion": 1.2,
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [
|
||||
2440,
|
||||
1700
|
||||
],
|
||||
"credentials": {
|
||||
"telegramApi": {
|
||||
"id": "I0xTTiASl7C1NZhJ",
|
||||
"name": "Telegram account"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
|
||||
Reference in New Issue
Block a user