feat(03-03): clean up UI after batch action
- Add Answer Batch Query to dismiss callback loading state - Add Delete Batch Confirm Message to remove confirmation message - Add Send Batch Result to display final success/failure message - Wire up complete flow: Format Result -> Answer -> Delete -> Send - UI cleanup keeps chat clean with only result message remaining
This commit is contained in:
@@ -988,6 +988,70 @@
|
|||||||
"type": "n8n-nodes-base.code",
|
"type": "n8n-nodes-base.code",
|
||||||
"typeVersion": 2,
|
"typeVersion": 2,
|
||||||
"position": [2220, 800]
|
"position": [2220, 800]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"method": "POST",
|
||||||
|
"url": "=https://api.telegram.org/bot{{ $credentials.telegramApi.accessToken }}/answerCallbackQuery",
|
||||||
|
"sendBody": true,
|
||||||
|
"specifyBody": "json",
|
||||||
|
"jsonBody": "={{ JSON.stringify({ callback_query_id: $json.queryId }) }}",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "http-answer-batch-query",
|
||||||
|
"name": "Answer Batch Query",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4.2,
|
||||||
|
"position": [2440, 800],
|
||||||
|
"credentials": {
|
||||||
|
"telegramApi": {
|
||||||
|
"id": "telegram-credential",
|
||||||
|
"name": "Telegram API"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"method": "POST",
|
||||||
|
"url": "=https://api.telegram.org/bot{{ $credentials.telegramApi.accessToken }}/deleteMessage",
|
||||||
|
"sendBody": true,
|
||||||
|
"specifyBody": "json",
|
||||||
|
"jsonBody": "={{ JSON.stringify({ chat_id: $('Format Batch Result').item.json.chatId, message_id: $('Format Batch Result').item.json.messageId }) }}",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
|
"id": "http-delete-batch-confirm-msg",
|
||||||
|
"name": "Delete Batch Confirm Message",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4.2,
|
||||||
|
"position": [2660, 800],
|
||||||
|
"credentials": {
|
||||||
|
"telegramApi": {
|
||||||
|
"id": "telegram-credential",
|
||||||
|
"name": "Telegram API"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parameters": {
|
||||||
|
"resource": "message",
|
||||||
|
"operation": "sendMessage",
|
||||||
|
"chatId": "={{ $('Format Batch Result').item.json.chatId }}",
|
||||||
|
"text": "={{ $('Format Batch Result').item.json.message }}",
|
||||||
|
"additionalFields": {
|
||||||
|
"parse_mode": "HTML"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "telegram-send-batch-result",
|
||||||
|
"name": "Send Batch Result",
|
||||||
|
"type": "n8n-nodes-base.telegram",
|
||||||
|
"typeVersion": 1.2,
|
||||||
|
"position": [2880, 800],
|
||||||
|
"credentials": {
|
||||||
|
"telegramApi": {
|
||||||
|
"id": "telegram-credential",
|
||||||
|
"name": "Telegram API"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"connections": {
|
"connections": {
|
||||||
@@ -1449,6 +1513,39 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"Format Batch Result": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Answer Batch Query",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Answer Batch Query": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Delete Batch Confirm Message",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Delete Batch Confirm Message": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Send Batch Result",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pinData": {},
|
"pinData": {},
|
||||||
|
|||||||
Reference in New Issue
Block a user