-
Notifications
You must be signed in to change notification settings - Fork 11
/
response.go
30 lines (22 loc) · 858 Bytes
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package tg
import "encoding/json"
// Response is Telegram Bot API response structure.
type Response struct {
// If equals true, the request was successful
// and the result of the query can be found in the 'result' field
Ok bool `json:"ok"`
// A human-readable description of the result.
// Empty if Ok is true.
// Contains error message if Ok is false.
Description string `json:"description"`
// Optional. The result of the request
Result json.RawMessage `json:"result"`
// Optional. ErrorCode is the error code returned by Telegram Bot API.
ErrorCode int `json:"error_code"`
// Optional.
Parameters *ResponseParameters `json:"parameters"`
// Optional. Parameters describes why a request was unsuccessful in some cases.
// Parameters *ResponseParameters `json:"parameters"`
// HTTP response status code.
StatusCode int `json:"-"`
}