mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-12-02 06:50:12 +00:00
Compare commits
No commits in common. "f6550bd40134a68addc4b3763c46341245e06597" and "b6eb4fe1348ce8cc6e2f408106f4e62f21df2774" have entirely different histories.
f6550bd401
...
b6eb4fe134
@ -18,22 +18,7 @@ data class StopState(override val context: ChatId) : BotState
|
||||
suspend fun main(args: Array<String>) {
|
||||
val botToken = args.first()
|
||||
|
||||
telegramBotWithBehaviourAndFSMAndStartLongPolling<BotState>(
|
||||
botToken,
|
||||
CoroutineScope(Dispatchers.IO),
|
||||
onStateHandlingErrorHandler = { state, e ->
|
||||
when (state) {
|
||||
is ExpectContentOrStopState -> {
|
||||
println("Thrown error on ExpectContentOrStopState")
|
||||
}
|
||||
is StopState -> {
|
||||
println("Thrown error on StopState")
|
||||
}
|
||||
}
|
||||
e.printStackTrace()
|
||||
state
|
||||
}
|
||||
) {
|
||||
telegramBotWithBehaviourAndFSMAndStartLongPolling<BotState>(botToken, CoroutineScope(Dispatchers.IO)) {
|
||||
strictlyOn<ExpectContentOrStopState> {
|
||||
sendMessage(
|
||||
it.context,
|
||||
|
@ -68,7 +68,7 @@ suspend fun main(vararg args: String) {
|
||||
val requestBody = call.receiveText()
|
||||
val webAppCheckData = Json { }.decodeFromString(WebAppDataWrapper.serializer(), requestBody)
|
||||
|
||||
val isSafe = telegramBotAPIUrlsKeeper.checkWebAppData(webAppCheckData.data, webAppCheckData.hash)
|
||||
val isSafe = telegramBotAPIUrlsKeeper.checkWebAppLink(webAppCheckData.data, webAppCheckData.hash)
|
||||
|
||||
call.respond(HttpStatusCode.OK, isSafe.toString())
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx768m
|
||||
|
||||
|
||||
kotlin_version=1.6.21
|
||||
telegram_bot_api_version=1.1.2
|
||||
telegram_bot_api_version=1.1.1
|
||||
micro_utils_version=0.10.4
|
||||
serialization_version=1.3.3
|
||||
ktor_version=2.0.1
|
||||
|
Loading…
Reference in New Issue
Block a user