mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
fix in SendMessage
This commit is contained in:
parent
ec37df82a9
commit
35dcd6ada7
@ -51,6 +51,10 @@
|
||||
|
||||
### 0.27.5
|
||||
|
||||
* `TelegramotAPI`:
|
||||
* Fix: `SendTextMessage` will correctly check the length of incoming text
|
||||
* Constant `maxTextLength` was added
|
||||
|
||||
### 0.27.4
|
||||
|
||||
* `TelegramBotAPI-extensions-utils`:
|
||||
|
@ -36,8 +36,8 @@ data class SendTextMessage(
|
||||
DisableWebPagePreview
|
||||
{
|
||||
init {
|
||||
if (text.length !in textLength) {
|
||||
throw IllegalArgumentException("Text must be in $textLength range")
|
||||
if (text.length > maxTextLength) {
|
||||
throw IllegalArgumentException("Text length must be less than $maxTextLength, but was ${text.length}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ val getUpdatesLimit = 1 .. 100
|
||||
val callbackQueryAnswerLength = 0 until 200
|
||||
val captionLength = 0 until 1024
|
||||
val textLength = 0 until 4096
|
||||
val maxTextLength = textLength.last + 1
|
||||
val userProfilePhotosRequestLimit = 0 .. 100
|
||||
val chatTitleLength = 1 until 255
|
||||
val chatDescriptionLength = 0 until 256
|
||||
|
Loading…
Reference in New Issue
Block a user