mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 23:29:33 +00:00
continue adding support of webapps updates
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package dev.inmo.tgbotapi.webapps
|
||||
|
||||
import kotlin.js.json
|
||||
|
||||
external interface DownloadFileParams {
|
||||
val url: String
|
||||
@JsName("file_name")
|
||||
val fileName: String
|
||||
}
|
||||
fun DownloadFileParams(
|
||||
url: String,
|
||||
fileName: String
|
||||
) = json(
|
||||
"url" to url,
|
||||
"file_name" to fileName
|
||||
).unsafeCast<DownloadFileParams>()
|
@@ -0,0 +1,13 @@
|
||||
package dev.inmo.tgbotapi.webapps
|
||||
|
||||
import dev.inmo.tgbotapi.types.Seconds
|
||||
import kotlin.js.json
|
||||
|
||||
external interface EmojiStatusParams {
|
||||
val duration: Seconds?
|
||||
}
|
||||
fun EmojiStatusParams(
|
||||
duration: Seconds
|
||||
): EmojiStatusParams = json(
|
||||
"duration" to duration
|
||||
).unsafeCast<EmojiStatusParams>()
|
@@ -1,5 +1,6 @@
|
||||
package dev.inmo.tgbotapi.webapps
|
||||
|
||||
import dev.inmo.tgbotapi.types.CustomEmojiId
|
||||
import dev.inmo.tgbotapi.types.PreparedMessageId
|
||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
||||
import dev.inmo.tgbotapi.webapps.accelerometer.Accelerometer
|
||||
@@ -71,8 +72,6 @@ external class WebApp {
|
||||
fun addToHomeScreen()
|
||||
fun checkHomeScreenStatus(callback: (HomeScreenStatus) -> Unit = definedExternally)
|
||||
|
||||
fun shareMessage(messageId: PreparedMessageId, callback: (Boolean) -> Unit = definedExternally)
|
||||
|
||||
@JsName("MainButton")
|
||||
val mainButton: BottomButton
|
||||
@JsName("SecondaryButton")
|
||||
@@ -144,6 +143,13 @@ external class WebApp {
|
||||
|
||||
fun shareToStory(mediaUrl: String, params: StoryShareParams? = definedExternally)
|
||||
|
||||
fun shareMessage(messageId: PreparedMessageId, callback: (Boolean) -> Unit = definedExternally)
|
||||
|
||||
fun setEmojiStatus(customEmojiId: CustomEmojiId, params: EmojiStatusParams = definedExternally, callback: (Boolean) -> Unit = definedExternally)
|
||||
fun requestEmojiStatusAccess(callback: (Boolean) -> Unit = definedExternally)
|
||||
|
||||
fun downloadFile(params: DownloadFileParams, callback: (Boolean) -> Unit = definedExternally)
|
||||
|
||||
fun requestWriteAccess(callback: ((Boolean) -> Unit)? = definedExternally)
|
||||
fun requestContact(callback: ((Boolean) -> Unit)? = definedExternally)
|
||||
}
|
||||
|
Reference in New Issue
Block a user