Package dev.inmo.tgbotapi.webapps

Types

Link copied to clipboard
external interface BackButton
Link copied to clipboard
interface Color
Link copied to clipboard
enum ColorScheme : Enum<ColorScheme>
Link copied to clipboard
typealias EventHandler = WebApp.() -> Unit
Link copied to clipboard
sealed class EventType
Link copied to clipboard
typealias HEXColor = String
Link copied to clipboard
typealias InvoiceClosedEventHandler = WebApp.(InvoiceClosedInfo) -> Unit
Link copied to clipboard
external class MainButton
Link copied to clipboard
data class MainButtonParams(    val text: String? = null,     val color: String? = null,     val textColor: String? = null,     val isActive: Boolean? = null,     val isVisible: Boolean? = null)
Link copied to clipboard
external interface Telegram
Link copied to clipboard
external interface ThemeParams
Link copied to clipboard
external interface ViewportChangedData
Link copied to clipboard
typealias ViewportChangedEventHandler = WebApp.(ViewportChangedData) -> Unit
Link copied to clipboard
external class WebApp
Link copied to clipboard
external interface WebAppChat
Link copied to clipboard
external interface WebAppInitData
Link copied to clipboard
external interface WebAppUser

Functions

Link copied to clipboard
suspend fun TelegramBot.answerWebAppQuery(result: InlineQueryResult): SentWebAppMessage?
Link copied to clipboard
fun WebAppUser.asUser(): User
Link copied to clipboard
inline fun handleResult(onSendData: () -> String?, onAnswerWebAppQuery: (WebAppQueryId) -> Unit)
Link copied to clipboard
fun WebApp.isInitDataSafe(botToken: String): Boolean
Link copied to clipboard
fun WebApp.onBackButtonClicked(eventHandler: EventHandler): () -> Unit
Link copied to clipboard
fun MainButton.onClick(eventHandler: EventHandler): MainButton
Link copied to clipboard
fun WebApp.onEvent(type: EventType, eventHandler: EventHandler): () -> Unit
fun WebApp.onEvent(type: EventType.InvoiceClosed, eventHandler: InvoiceClosedEventHandler): (InvoiceClosedInfo) -> Unit
fun WebApp.onEvent(type: EventType.ViewportChanged, eventHandler: ViewportChangedEventHandler): (ViewportChangedData) -> Unit
Link copied to clipboard
fun WebApp.onInvoiceClosed(eventHandler: InvoiceClosedEventHandler): (InvoiceClosedInfo) -> Unit
Link copied to clipboard
fun WebApp.onMainButtonClicked(eventHandler: EventHandler): () -> Unit
Link copied to clipboard
fun WebApp.onSettingsButtonClicked(eventHandler: EventHandler): () -> Unit
Link copied to clipboard
fun WebApp.onThemeChanged(eventHandler: EventHandler): () -> Unit
Link copied to clipboard
fun WebApp.onViewportChanged(eventHandler: ViewportChangedEventHandler): (ViewportChangedData) -> Unit
Link copied to clipboard
inline fun sendDataOrWorkWithQueryId(onSendData: () -> String?, onAnswerWebAppQuery: (WebAppQueryId) -> Unit)
Link copied to clipboard
fun MainButton.setParams(params: MainButtonParams): MainButton

Properties

Link copied to clipboard
val WebApp.colorScheme: ColorScheme
Link copied to clipboard
val Window.Telegram: Telegram
Link copied to clipboard
val telegram: Telegram
Link copied to clipboard
val webApp: WebApp