Empty keyboard if the Extra.HTML().markup() is async
See original GitHub issueSync function:
Extra.HTML().markup((m) => {
return m.inlineKeyboard([
Markup.callbackButton('oke', 'lang1'),
])
})
result:
Extra {
parse_mode: 'HTML',
reply_markup: { inline_keyboard: [ [Array] ] } }
Async function:
Extra.HTML().markup(async (m) => {
return m.inlineKeyboard([
Markup.callbackButton(`${(await Translate('oke'))}`, 'lang1'),
])
})
result:
Extra {
parse_mode: 'HTML',
reply_markup: { } }
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Pyrogram: The provided reply markup for the game is ...
But I met this error when I want to call this command /popspike to send my game to user, so I failed to...
Read more >HTML: A good basis for accessibility - Learn web development
One key aspect of the accessibility of UI controls is that by default, browsers allow them to be manipulated by the keyboard. You...
Read more >JSDoc: Widget: grid
A jQuery UI widget that implements a navigable data grid that supports selection and editing. It follows the DHTML Style Guide and WAI-ARIA ......
Read more >JavaScript Tutorial: The Basics
As a result of the document.write() , the BODY section of this document ... extra white space (newlines, blanks, tabs) in an HTML...
Read more >html5.h — Emscripten 3.1.26-git (dev) documentation
All event handlers are also automatically unregistered when the C exit() ... be an empty string if the browser or device doesn't know...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
async always return Promise
Also have run into the same problem.
Note that somehow the
reply_markup
was empty even though the function didn’t have any async calls in it. I spent like an hour trying to find an issue.It is super logical that the function could be awaitable, I have no idea why it can’t do that. This is not intuitive and can potentially cause tons of misunderstanding.
I thought async-await was specifically implemented to provide a safe, readable and understandable way to wait for a completion of an asynchronous task, but this issue here kind of makes it incompatible?