windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
259 stars 116 forks source link

answerCallbackQuery with cache_time #266

Closed skynet-cloud closed 1 year ago

skynet-cloud commented 1 year ago

Caught exception in sender node: Error: ETELEGRAM: 400 Bad Request: query is too old and response timeout expired or query ID is invalid when processing message

I need Set cache_time but rour lib not supported

https://core.telegram.org/bots/api#answercallbackquery

case 'answerCallbackQuery': if (this.hasContent(msg)) { // The new signature expects one object instead of three arguments. let callbackQueryId = msg.payload.callbackQueryId; let options = { callback_query_id: callbackQueryId, text: msg.payload.content, show_alert: msg.payload.options, }; node.telegramBot .answerCallbackQuery(callbackQueryId, options) .catch(function (ex) { node.processError(ex, msg, nodeSend, nodeDone); }) .then(function (result) { node.processResult(result, msg, nodeSend, nodeDone); }); } break;

windkh commented 1 year ago

You are correct. This is a problem which needs to be fixed: instead of assigning the options to show_alert it should contain all options in future: show_alert: msg.payload.options

windkh commented 1 year ago

please test 13.0.0