Closed zennomi closed 6 months ago
When the do function returns true the menu is updated which clears the loading effect as something is happening. When false is returned this is not done → it keeps showing the loading effect.
The loading effect appears until ctx.answerCallbackQuery([…])
is used (or the message is updated). `answerCallbackQuery indicates that the bot actually handles the button press and something is happening.
Hope this helps both to solve the issue and to understand the backgrounds of it. Otherwise feel free to ask ahead :)
I think that if false is returned, it should clear the loading effect
From personal experience I don't think its as helpful there. The idea of ctx.answerCallbackQuery('message')
is to provide a message. With the special case of an empty message just to signal that its handled.
Updating the menu is a visible response that something happened. When thats not the case the user should be told the reason so a message should be specified. The menu library can not know this. If the menu library would just send an empty message developers wouldnt specify it themselves which ends up being less helpful to users. When the developer does this with a message and the menu library does this again without a message it would end up doing two requests for the same thing which is also not ideal.
So I would keep it the way it is. Or am I overlooking something?
I'll just close this due to inactivity. If you have any questions feel free to ask ahead!
Describe your goal Disable the loading effect of inline button after pressing it.
Expected If the do function returns false, the inline button will keep loading in 15s. If the do function returns true, the inline button will stop loading after 1-2 seconds. How to disable this effect? Thanks.