Merge pull request #227 from bcmk/passing-error-code

Passing error code
bot-api-6.1
Syfaro 2019-04-24 04:32:50 -05:00 committed by GitHub
commit 87e7035a90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

2
bot.go
View File

@ -84,7 +84,7 @@ func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse,
if apiResp.Parameters != nil { if apiResp.Parameters != nil {
parameters = *apiResp.Parameters parameters = *apiResp.Parameters
} }
return apiResp, Error{apiResp.Description, parameters} return apiResp, Error{Code: apiResp.ErrorCode, Message: apiResp.Description, ResponseParameters: parameters}
} }
return apiResp, nil return apiResp, nil

View File

@ -949,6 +949,7 @@ type PreCheckoutQuery struct {
// Error is an error containing extra information returned by the Telegram API. // Error is an error containing extra information returned by the Telegram API.
type Error struct { type Error struct {
Code int
Message string Message string
ResponseParameters ResponseParameters
} }