toggle menu
Telegram Bot
7.6.2
common
switch theme
search in API
Telegram Bot
/
eu.vendeli.tgbot.types.internal
/
Response
Response
@
Serializable
sealed
class
Response
<
T
>
Inheritors
Success
Failure
Members
Members & Extensions
Types
Failure
Link copied to clipboard
@
Serializable
@
SerialName
(
value
=
"false"
)
data
class
Failure
(
val
errorCode
:
Int
,
val
description
:
String
?
=
null
,
val
parameters
:
ResponseParameters
?
=
null
)
:
Response
<
Nothing
>
Success
Link copied to clipboard
@
Serializable
@
SerialName
(
value
=
"true"
)
data
class
Success
<
T
>
(
val
result
:
T
)
:
Response
<
T
>
Properties
ok
Link copied to clipboard
val
ok
:
Boolean
Functions
get
Or
Null
Link copied to clipboard
fun
<
T
>
Response
<
T
>
.
getOrNull
(
)
:
T
?
Get response or null on failure.
is
Success
Link copied to clipboard
fun
<
T
>
Response
<
T
>
.
isSuccess
(
)
:
Boolean
Whether the request completed successfully.
on
Failure
Link copied to clipboard
inline
fun
<
T
>
Response
<
T
>
.
onFailure
(
block
:
(
Response.Failure
)
->
Unit
)
:
T
?