all repos — telegram-bot-api @ 016d6acdf35787efe8b5bec12b0cfe91b04b5f8c

Golang bindings for the Telegram Bot API

Passing error code
bcmk 45658475+bcmk@users.noreply.github.com
Fri, 01 Mar 2019 20:17:35 +0400
commit

016d6acdf35787efe8b5bec12b0cfe91b04b5f8c

parent

ec221ba9ea458cd5386c35dd90af04b8a895f8eb

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M bot.gobot.go

@@ -84,7 +84,7 @@ parameters := ResponseParameters{}

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
M types.gotypes.go

@@ -897,6 +897,7 @@ }

// Error is an error containing extra information returned by the Telegram API. type Error struct { + Code int Message string ResponseParameters }