TelegramApiResult

data class TelegramApiResult<T : Any>(val ok: Boolean, val result: T? = null, val description: String? = null, val errorCode: Int? = null, val parameters: ResponseParameters? = null)(source)

The Telegram API response data.

The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals True, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

Author

ForteScarlet

Constructors

Link copied to clipboard
constructor(ok: Boolean, result: T? = null, description: String? = null, errorCode: Int? = null, parameters: ResponseParameters? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val description: String? = null

May have an optional String field 'description' with a human-readable description of the result.

Link copied to clipboard
@SerialName(value = "error_code")
val errorCode: Int? = null

An Integer 'error_code' field is also returned, but its contents are subject to change in the future.

Link copied to clipboard
val ok: Boolean
Link copied to clipboard

Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

Link copied to clipboard
val result: T? = null

If 'ok' equals True, the request was successful and the result of the query can be found in the 'result' field.

Inherited functions