1.Generate an InlineKeyboardButton and send it as an InlineKeyboardMarkup in editMessageText()
2.The user clicks on this key on his Android phone, causing a callback handler to be called on the bot's side.
3.Eventually the bot generates a new page including new inlineKeyboardButtons (with exactly the same text and same callback query data) and send it to the user in the next editMessageText(). However, the new inlineKeyboardMarkup button still keeps that loading turning circles!
The loading circle should disappear after a new inlineKeyboardButton is sent to the user via editMessageText()
The new inlineKeyboardButtons (with text similar to previous ones) keep their turning loading circle. This happens only on Android Telegram clients and not on iOS/Windows clients.
and in my case it only happens if the buttons have the same data attribute
@MohGanji I believe this is Android client bug.
Anyway, when you call editMessageText with same data, Telegram will throw error, and here we have only one way to hide loading circle: ctx.answerCbQuery()
@dotcypress thanks.
I googled and found out that I can use telegrams answerCallbackQuery or in your wrapper ctx.answerCbQuery to hide the loading circle, but I thought this is just a dirty way to get things done and I wanted to know if there was a better way.
thank you anyway, I look forward to hearing about this issue getting fixed.
UPDATED: Everything is working. I use the firebase functions and I in Russia. So everything works in production, but on my local machine the telegrams are blocked by my provider, so i can reply, but can't make request (answerCbQuery)
Also note that telegraf.js does not register any errors in the console if the telegram is blocked by an Internet provider. Is this the expected behavior?
OLD:
Same.
ctx.answerCbQuery does not work in the official Android client, but it works in the web version.
I reported this in support.
My code:
function menuStart() {
return Markup.inlineKeyboard([
Markup.callbackButton('袠谐褉邪褌褜', 'game'),
Markup.callbackButton('袩褉邪胁懈谢邪', 'rules')
]).extra()
}
bot.action('main', (ctx) => {
ctx.editMessageText('袚谢邪胁薪芯械 屑械薪褞', menuStart())
ctx.answerCbQuery()
})
bot.action('rules', (ctx) => {
ctx.editMessageText('袩褉邪胁懈谢邪', Extra.HTML().markup(m => m.inlineKeyboard([
m.callbackButton('袧邪蟹邪写', 'main')
])))
ctx.answerCbQuery()
})
Most helpful comment
@MohGanji I believe this is Android client bug.
Anyway, when you call
editMessageTextwith same data, Telegram will throw error, and here we have only one way to hide loading circle:ctx.answerCbQuery()