Skip to content

Commit

Permalink
Editting bot-issued messages doesn't return an error now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Byrd committed Dec 26, 2017
1 parent 3f24832 commit 389bcd3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,20 @@ func extractMsgResponse(respJSON []byte) (*Message, error) {

err := json.Unmarshal(respJSON, &resp)
if err != nil {
return nil, errors.Wrap(err, "bad response json")
var resp struct {
Ok bool
Result bool
Description string
}

err := json.Unmarshal(respJSON, &resp)
if err != nil {
return nil, errors.Wrap(err, "bad response json")
}

if !resp.Ok {
return nil, errors.Errorf("api error: %s", resp.Description)
}
}

if !resp.Ok {
Expand Down

0 comments on commit 389bcd3

Please sign in to comment.