mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-08 17:33:47 +00:00
Merge pull request #875 from SuLG-ik/main-button-off-click-issue
Make MainButton.onClick(() -> Unit) and MainButton.offClick(() -> Unit) public
This commit is contained in:
commit
4343dbbde8
@ -22,8 +22,8 @@ external class MainButton {
|
|||||||
fun showProgress(leaveActive: Boolean = definedExternally): MainButton
|
fun showProgress(leaveActive: Boolean = definedExternally): MainButton
|
||||||
fun hideProgress(): MainButton
|
fun hideProgress(): MainButton
|
||||||
|
|
||||||
internal fun onClick(eventHandler: () -> Unit): MainButton
|
fun onClick(eventHandler: () -> Unit): MainButton
|
||||||
internal fun offClick(eventHandler: () -> Unit): MainButton
|
fun offClick(eventHandler: () -> Unit): MainButton
|
||||||
|
|
||||||
internal fun setParams(params: Json): MainButton
|
internal fun setParams(params: Json): MainButton
|
||||||
}
|
}
|
||||||
@ -36,6 +36,7 @@ data class MainButtonParams(
|
|||||||
val isVisible: Boolean? = null
|
val isVisible: Boolean? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Deprecated(message="Use onClick without EventHandler")
|
||||||
fun MainButton.onClick(eventHandler: EventHandler) = onClick {
|
fun MainButton.onClick(eventHandler: EventHandler) = onClick {
|
||||||
val that = js("this").unsafeCast<WebApp>()
|
val that = js("this").unsafeCast<WebApp>()
|
||||||
that.eventHandler()
|
that.eventHandler()
|
||||||
|
Loading…
Reference in New Issue
Block a user