Package-level declarations
The Telegram API and Telegram methods.
Types
Link copied to clipboard
body is always null
TelegramApi. Will use a GET
request directly.
Link copied to clipboard
A SimpleBodyTelegramApi whose body is explicitly MultiPartFormDataContent.
Link copied to clipboard
Describes why a request was unsuccessful.
Link copied to clipboard
An ordinary extensible TelegramApi. Post
is used if body is not null, application/json
is used if body is not MultiPartFormDataContent, and application/x-www-form-urlencoded
is used otherwise.
Link copied to clipboard
Link copied to clipboard
open class TelegramApiException(message: String? = null, cause: Throwable? = null) : RuntimeException
Link copied to clipboard
data class TelegramApiResult<T : Any>(val ok: Boolean, val result: T? = null, val description: String? = null, val errorCode: Int? = null, val parameters: ResponseParameters? = null)
The Telegram API response data.
Link copied to clipboard
open class TelegramApiResultNotOkException(val result: TelegramApiResult<*>, message: String? = "result: ", cause: Throwable? = null) : TelegramApiException
Link copied to clipboard
class UnknownUpdatedFieldException(message: String? = "Unknown updated field") : IllegalArgumentException
Inherited functions
Link copied to clipboard
suspend fun <R : Any> TelegramApi<R>.requestData(client: HttpClient, token: String, server: Url?): R
suspend fun <R : Any> TelegramApi<R>.requestData(client: HttpClient, token: String, server: String? = null): R
Request the TelegramApi by client with token.
Link copied to clipboard
suspend fun TelegramApi<*>.requestRaw(client: HttpClient, token: String, server: Url?): HttpResponse
suspend fun TelegramApi<*>.requestRaw(client: HttpClient, token: String, server: String? = null): HttpResponse
Request the TelegramApi by client with token.
Link copied to clipboard
suspend fun <R : Any> TelegramApi<R>.requestResult(client: HttpClient, token: String, server: Url?): TelegramApiResult<R>
suspend fun <R : Any> TelegramApi<R>.requestResult(client: HttpClient, token: String, server: String? = null): TelegramApiResult<R>
Request the TelegramApi by client with token.
Link copied to clipboard
Get TelegramApiResult.result, or throw TelegramApiResultNotOkException if TelegramApiResult.ok = false
or TelegramApiResult.result is null.