LoginURL and LoginURLInlineKeyboardButton

This commit is contained in:
InsanusMokrassar 2019-06-01 17:21:02 +08:00
parent f50d2c3355
commit 5bc3169578
3 changed files with 32 additions and 0 deletions

View File

@ -2,6 +2,8 @@
## 0.16.0 Bot API 4.3
* `LoginURL` and `LoginURLInlineKeyboardButton` has been added
## 0.15.0
* Old `UpdatesPoller` removed (was deprecated)

View File

@ -84,6 +84,12 @@ const val lastErrorDateField = "last_error_date"
const val lastErrorMessageField = "last_error_message"
const val votesCountField = "voter_count"
const val isClosedField = "is_closed"
const val loginUrlField = "login_url"
const val forwardTextField = "forward_text"
const val botUsernameField = "bot_username"
const val requestWriteAccessField = "request_write_access"
const val photoUrlField = "photo_url"

View File

@ -0,0 +1,24 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardButtons
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class LoginURLInlineKeyboardButton(
override val text: String,
@SerialName(loginUrlField)
val loginUrl: LoginURL
) : InlineKeyboardButton
@Serializable
data class LoginURL(
@SerialName(urlField)
val url: String,
@SerialName(forwardTextField)
val forwardText: String? = null,
@SerialName(botUsernameField)
val botUsername: String? = null,
@SerialName(requestWriteAccessField)
val requestWriteAccess: Boolean? = null
)