1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +00:00

a little fix

This commit is contained in:
InsanusMokrassar 2019-12-13 23:36:31 +06:00
parent 5249fb517f
commit 1659f6f909

View File

@ -11,7 +11,7 @@ fun newRequestException(
) = response.description ?.let { description ->
when {
description == "Bad Request: reply message not found" -> ReplyMessageNotFoundException(response, plainAnswer, message, cause)
description.contains("Bad Request: message is not modified") -> MessageIsNotModifierException(response, plainAnswer, message, cause)
description.contains("Bad Request: message is not modified") -> MessageIsNotModifiedException(response, plainAnswer, message, cause)
description == "Unauthorized" -> UnauthorizedException(response, plainAnswer, message, cause)
else -> null
}
@ -36,5 +36,5 @@ class UnauthorizedException(response: Response, plainAnswer: String, message: St
class ReplyMessageNotFoundException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
RequestException(response, plainAnswer, message, cause)
class MessageIsNotModifierException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
class MessageIsNotModifiedException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
RequestException(response, plainAnswer, message, cause)