/
response.go
21 lines (18 loc) 路 1010 Bytes
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package telegram
import (
"encoding/json"
)
/*
Contains information about why a request was unsuccessful.
*/
type responseParameters struct {
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"` // Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
RetryAfter int `json:"retry_after,omitempty"` // Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
}
type response struct {
Ok bool `json:"ok"`
Description string `json:"description"`
Result json.RawMessage `json:"result"`
ErrorCode int `json:"error_code"`
Parameters *responseParameters `json:"parameters"`
}