From aca076381b4203af7fb686ec9913a58c1a4ca68f Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 5 Feb 2023 23:26:41 +0600 Subject: [PATCH] renames in request buttons --- .../types/buttons/KeyboardButtonRequestChat.kt | 7 ++----- .../buttons/reply/ReplyKeyboardButtonsShortcuts.kt | 13 ++++++++++--- .../utils/types/buttons/ReplyKeyboardBuilder.kt | 13 ++++++++++--- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestChat.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestChat.kt index a78ed9bb78..487b9ad57f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestChat.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestChat.kt @@ -10,11 +10,8 @@ import dev.inmo.tgbotapi.types.chatIsForumField import dev.inmo.tgbotapi.types.request.RequestId import dev.inmo.tgbotapi.types.requestIdField import dev.inmo.tgbotapi.types.userAdministratorRightsField -import kotlinx.serialization.EncodeDefault -import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -import kotlinx.serialization.Transient @Serializable data class KeyboardButtonRequestChat( @@ -25,9 +22,9 @@ data class KeyboardButtonRequestChat( @SerialName(chatIsForumField) val isForum: Boolean? = null, @SerialName(chatHasUsernameField) - val withUsername: Boolean? = null, + val isPublic: Boolean? = null, @SerialName(chatIsCreatedField) - val ownedBy: Boolean? = null, + val isOwnedBy: Boolean? = null, @SerialName(userAdministratorRightsField) val userRightsInChat: ChatAdministratorRights? = null, @SerialName(botAdministratorRightsField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/reply/ReplyKeyboardButtonsShortcuts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/reply/ReplyKeyboardButtonsShortcuts.kt index dba7cac982..e6c495d990 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/reply/ReplyKeyboardButtonsShortcuts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/reply/ReplyKeyboardButtonsShortcuts.kt @@ -154,14 +154,21 @@ inline fun requestChatReplyButton( requestId: RequestId, isChannel: Boolean? = null, isForum: Boolean? = null, - withUsername: Boolean? = null, - ownedBy: Boolean? = null, + isPublic: Boolean? = null, + isOwnedBy: Boolean? = null, userRightsInChat: ChatAdministratorRights? = null, botRightsInChat: ChatAdministratorRights? = null, botIsMember: Boolean = false ) = requestChatReplyButton( text, KeyboardButtonRequestChat( - requestId, isChannel, isForum, withUsername, ownedBy, userRightsInChat, botRightsInChat, botIsMember + requestId = requestId, + isChannel = isChannel, + isForum = isForum, + isPublic = isPublic, + isOwnedBy = isOwnedBy, + userRightsInChat = userRightsInChat, + botRightsInChat = botRightsInChat, + botIsMember = botIsMember ) ) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt index a41a2cb0f1..12a6216558 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboardBuilder.kt @@ -231,14 +231,21 @@ inline fun ReplyKeyboardRowBuilder.requestChatButton( requestId: RequestId, isChannel: Boolean? = null, isForum: Boolean? = null, - withUsername: Boolean? = null, - ownedBy: Boolean? = null, + isPublic: Boolean? = null, + isOwnedBy: Boolean? = null, userRightsInChat: ChatAdministratorRights? = null, botRightsInChat: ChatAdministratorRights? = null, botIsMember: Boolean? = null ) = requestChatButton( text, KeyboardButtonRequestChat( - requestId, isChannel, isForum, withUsername, ownedBy, userRightsInChat, botRightsInChat, botIsMember + requestId = requestId, + isChannel = isChannel, + isForum = isForum, + isPublic = isPublic, + isOwnedBy = isOwnedBy, + userRightsInChat = userRightsInChat, + botRightsInChat = botRightsInChat, + botIsMember = botIsMember ) )