From eab147a38f3f42846b2a7d3962aaa6fdc975c151 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 29 Jan 2019 08:18:07 +0800 Subject: [PATCH] update texts lengths restrictions --- CHANGELOG.md | 2 ++ .../TelegramBotAPI/types/Common.kt | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b290dde4..7862510af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ ### 0.9.1 +* Updated built-in lengths restrictions + ### 0.8.5 * Add extension `String#toMarkdown` 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 8e5431c570..e9e28b1d50 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -16,17 +16,17 @@ typealias ShippingOptionIdentifier = String typealias StartParameter = String typealias InlineMessageIdentifier = String -val callbackQueryAnswerLength = 0 .. 200 -val captionLength = 0 .. 1024 -val textLength = 0 .. 4096 +val callbackQueryAnswerLength = 0 until 200 +val captionLength = 0 until 1024 +val textLength = 0 until 4096 val userProfilePhotosRequestLimit = 0 .. 100 -val chatTitleLength = 1 .. 255 -val chatDescriptionLength = 0 .. 255 -val inlineResultQueryIdLingth = 1 .. 64 +val chatTitleLength = 1 until 255 +val chatDescriptionLength = 0 until 256 +val inlineResultQueryIdLingth = 1 until 64 -val invoiceTitleLimit = 1 .. 32 -val invoiceDescriptionLimit = 1 .. 255 -val invoicePayloadBytesLimit = 1 .. 128 +val invoiceTitleLimit = 1 until 32 +val invoiceDescriptionLimit = 1 until 256 +val invoicePayloadBytesLimit = 1 until 128 const val chatIdField = "chat_id" const val messageIdField = "message_id"