mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-12-22 00:27:19 +00:00
start migration onto 9.2.0
This commit is contained in:
parent
35e0cb4a46
commit
d97c2a0562
@ -110,6 +110,32 @@ fun main() {
|
||||
appendText("Alert")
|
||||
} ?: window.alert("Unable to load body")
|
||||
|
||||
document.body ?.appendElement("p", {})
|
||||
|
||||
document.body ?.appendElement("button") {
|
||||
addEventListener("click", { webApp.requestWriteAccess() })
|
||||
appendText("Request write access without callback")
|
||||
} ?: window.alert("Unable to load body")
|
||||
|
||||
document.body ?.appendElement("button") {
|
||||
addEventListener("click", { webApp.requestWriteAccess { document.body ?.log("Write access request result: $it") } })
|
||||
appendText("Request write access with callback")
|
||||
} ?: window.alert("Unable to load body")
|
||||
|
||||
document.body ?.appendElement("p", {})
|
||||
|
||||
document.body ?.appendElement("button") {
|
||||
addEventListener("click", { webApp.requestContact() })
|
||||
appendText("Request contact without callback")
|
||||
} ?: window.alert("Unable to load body")
|
||||
|
||||
document.body ?.appendElement("button") {
|
||||
addEventListener("click", { webApp.requestContact { document.body ?.log("Contact request result: $it") } })
|
||||
appendText("Request contact with callback")
|
||||
} ?: window.alert("Unable to load body")
|
||||
|
||||
document.body ?.appendElement("p", {})
|
||||
|
||||
document.body ?.appendElement("button") {
|
||||
addEventListener("click", {
|
||||
webApp.showConfirm(
|
||||
@ -171,6 +197,12 @@ fun main() {
|
||||
onSettingsButtonClicked {
|
||||
document.body ?.log("Settings button clicked")
|
||||
}
|
||||
onWriteAccessRequested {
|
||||
document.body ?.log("Write access request result: $it")
|
||||
}
|
||||
onContactRequested {
|
||||
document.body ?.log("Contact request result: $it")
|
||||
}
|
||||
}
|
||||
webApp.ready()
|
||||
}.onFailure {
|
||||
|
@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2g
|
||||
|
||||
|
||||
kotlin_version=1.8.22
|
||||
telegram_bot_api_version=9.1.2
|
||||
telegram_bot_api_version=9.2.0
|
||||
micro_utils_version=0.19.9
|
||||
serialization_version=1.5.1
|
||||
ktor_version=2.3.3
|
||||
|
Loading…
Reference in New Issue
Block a user