Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
windka committed Oct 7, 2023
1 parent a4ab142 commit c78757d
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions telegrambot/99-telegrambot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2486,25 +2486,27 @@ module.exports = function (RED) {

case 'callback_query':
case 'answerCallbackQuery':
let callbackQueryId = msg.payload.callbackQueryId;
{
let callbackQueryId = msg.payload.callbackQueryId;

let options = msg.payload.options;
if (options === undefined) {
options = {};
}
let options = msg.payload.options;
if (options === undefined) {
options = {};
}

if (options.text === undefined && msg.payload.content !== undefined) {
options.text = msg.payload.content;
}
if (options.text === undefined && msg.payload.content !== undefined) {
options.text = msg.payload.content;
}

telegramBot
.answerCallbackQuery(callbackQueryId, options)
.catch(function (ex) {
node.processError(ex, msg, nodeSend, nodeDone);
})
.then(function (result) {
node.processResult(result, msg, nodeSend, nodeDone);
});
telegramBot
.answerCallbackQuery(callbackQueryId, options)
.catch(function (ex) {
node.processError(ex, msg, nodeSend, nodeDone);
})
.then(function (result) {
node.processResult(result, msg, nodeSend, nodeDone);
});
}
break;

case 'inline_query':
Expand Down

0 comments on commit c78757d

Please sign in to comment.