We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c297152 commit a51e05bCopy full SHA for a51e05b
discord/notify.go
@@ -51,20 +51,23 @@ func (c *client) Send(message string) error {
51
Content: c.opt.Text,
52
}
53
54
- inrec, _ := json.Marshal(whMsg)
+ inrec, err := json.Marshal(whMsg)
55
+ if err != nil {
56
+ return err
57
+ }
58
+
59
params := &req.Param{}
- json.Unmarshal(inrec, params)
60
+ err = json.Unmarshal(inrec, params)
61
62
63
64
65
ApiURL = ApiURL + c.opt.Channel + "/" + c.opt.Token
66
resp, err := req.Post(ApiURL, *params)
67
if err != nil {
68
return err
69
- r := &Resp{}
- err = resp.ToJSON(r)
70
- if err != nil || err.Error() != "unexpected end of JSON input" {
- return err
- }
- return nil
71
+ r := &Resp{}
72
+ return resp.ToJSON(r)
73
0 commit comments