1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-13 05:15:26 +00:00
tgbotapi/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt

71 lines
2.0 KiB
Kotlin
Raw Normal View History

2018-12-26 08:07:24 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardButtons
2019-06-02 14:02:12 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.games.CallbackGame
2019-08-12 09:46:31 +00:00
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
2020-04-13 05:11:09 +00:00
import kotlinx.serialization.json.JsonObject
@Serializable(InlineKeyboardButtonSerializer::class)
2019-06-02 14:02:12 +00:00
sealed class InlineKeyboardButton {
abstract val text: String
}
2020-04-13 05:11:09 +00:00
@Serializable
data class UnknownInlineKeyboardButton internal constructor(
override val text: String,
val rawData: JsonElement
2020-04-13 05:11:09 +00:00
) : InlineKeyboardButton()
2019-06-02 14:02:12 +00:00
@Serializable
data class PayInlineKeyboardButton(
override val text: String,
@SerialName(payField)
2019-06-02 14:02:12 +00:00
val pay: Boolean
) : InlineKeyboardButton()
@Serializable
data class CallbackDataInlineKeyboardButton(
@SerialName(textField)
override val text: String,
@SerialName(callbackDataField)
val callbackData: String
) : InlineKeyboardButton()
@Serializable
data class CallbackGameInlineKeyboardButton(
@SerialName(textField)
override val text: String,
@SerialName(callbackGameField)
val callbackGame: CallbackGame
) : InlineKeyboardButton()
2019-06-02 14:02:12 +00:00
@Serializable
data class LoginURLInlineKeyboardButton(
override val text: String,
@SerialName(loginUrlField)
val loginUrl: LoginURL
) : InlineKeyboardButton()
@Serializable
data class SwitchInlineQueryCurrentChatInlineKeyboardButton(
override val text: String,
@SerialName(switchInlineQueryCurrentChatField)
val switchInlineQueryCurrentChat: String
) : InlineKeyboardButton()
@Serializable
data class SwitchInlineQueryInlineKeyboardButton(
override val text: String,
@SerialName(switchInlineQueryField)
2019-06-02 14:02:12 +00:00
val switchInlineQuery: String
) : InlineKeyboardButton()
@Serializable
data class URLInlineKeyboardButton(
override val text: String,
@SerialName(urlField)
2019-06-02 14:02:12 +00:00
val url: String
) : InlineKeyboardButton()