Skip to content

Commit

Permalink
Callback function of ask block must be async
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Jan 13, 2025
1 parent 9bdbd37 commit 72b42bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion admin/blockly.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ Blockly.JavaScript['telegram_ask'] = function(block) {
answers.map(a => ` [ { text: ${a.answer}, callback_data: '${a.id}' } ],`).join('\n') + '\n' +
` ],\n` +
` }\n` +
`}, msg => {\n${logAnswer}` +
`}, async (msg) => {\n${logAnswer}` +
answers.map(a => ` if (msg?.data && msg.data == '${a.id}') {\n${Blockly.JavaScript.prefixLines(a.statement, Blockly.JavaScript.INDENT)} }`).join('\n') +
`\n});\n${logText}`;
};

0 comments on commit 72b42bf

Please sign in to comment.