diff --git a/bot.go b/bot.go index 85e16c1..88d907e 100644 --- a/bot.go +++ b/bot.go @@ -84,7 +84,7 @@ func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, if apiResp.Parameters != nil { parameters = *apiResp.Parameters } - return apiResp, Error{apiResp.Description, parameters} + return apiResp, Error{Code: apiResp.ErrorCode, Message: apiResp.Description, ResponseParameters: parameters} } return apiResp, nil diff --git a/types.go b/types.go index 51ac55d..52cb36c 100644 --- a/types.go +++ b/types.go @@ -949,6 +949,7 @@ type PreCheckoutQuery struct { // Error is an error containing extra information returned by the Telegram API. type Error struct { + Code int Message string ResponseParameters }