diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e907a8be3..81e53c9afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 055e4b0cd0..b0dc8b4388 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -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" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton.kt new file mode 100644 index 0000000000..fcf0bea1fa --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton.kt @@ -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 +)