mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-08 09:23:47 +00:00
small refactor of MainButton
This commit is contained in:
parent
4343dbbde8
commit
4ce26c707e
@ -22,6 +22,9 @@ external class MainButton {
|
||||
fun showProgress(leaveActive: Boolean = definedExternally): MainButton
|
||||
fun hideProgress(): MainButton
|
||||
|
||||
/**
|
||||
* **This method argument do not accept `this` [WebApp] object**
|
||||
*/
|
||||
fun onClick(eventHandler: () -> Unit): MainButton
|
||||
fun offClick(eventHandler: () -> Unit): MainButton
|
||||
|
||||
@ -36,7 +39,7 @@ data class MainButtonParams(
|
||||
val isVisible: Boolean? = null
|
||||
)
|
||||
|
||||
@Deprecated(message="Use onClick without EventHandler")
|
||||
@Deprecated(message = "Use onClick without EventHandler")
|
||||
fun MainButton.onClick(eventHandler: EventHandler) = onClick {
|
||||
val that = js("this").unsafeCast<WebApp>()
|
||||
that.eventHandler()
|
||||
|
Loading…
Reference in New Issue
Block a user