diff --git a/request.go b/request.go index d99fcda..33b7612 100644 --- a/request.go +++ b/request.go @@ -10,17 +10,17 @@ import ( http "github.com/valyala/fasthttp" ) -// Response represents a response from the Telegram API with the result stored raw. If ok equals true, +// response represents a response from the Telegram API with the result stored raw. 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 error field (e.g. // SHORT_NAME_REQUIRED). -type Response struct { +type response struct { Ok bool `json:"ok"` Error string `json:"error"` Result *gojson.RawMessage `json:"result"` } -func request(method, path string, args *http.Args) (*Response, error) { +func request(method, path string, args *http.Args) (*response, error) { requestURI := &url.URL{ Scheme: "https", Host: "api.telegra.ph", @@ -36,7 +36,7 @@ func request(method, path string, args *http.Args) (*Response, error) { return nil, err } - var resp Response + var resp response if err := json.Unmarshal(body, &resp); err != nil { return nil, err }