mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-04 15:33:47 +00:00
small refactoring of KtorRequestsExecutor
This commit is contained in:
parent
bf8096ece2
commit
84eb2fac7c
@ -76,7 +76,7 @@ class KtorRequestsExecutor(
|
|||||||
}
|
}
|
||||||
val responseObject = jsonFormatter.extractResult(content)
|
val responseObject = jsonFormatter.extractResult(content)
|
||||||
|
|
||||||
val result = responseObject.result ?.let {
|
(responseObject.result ?.let {
|
||||||
jsonFormatter.fromJson(request.resultDeserializer(), it)
|
jsonFormatter.fromJson(request.resultDeserializer(), it)
|
||||||
} ?: responseObject.parameters ?.let {
|
} ?: responseObject.parameters ?.let {
|
||||||
val error = it.error
|
val error = it.error
|
||||||
@ -92,8 +92,7 @@ class KtorRequestsExecutor(
|
|||||||
content,
|
content,
|
||||||
"Can't get result object from $content"
|
"Can't get result object from $content"
|
||||||
)
|
)
|
||||||
}
|
})
|
||||||
result
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user