Skip to content

Commit

Permalink
feature: replace wechat by feishu (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: Cadmus <[email protected]>
  • Loading branch information
CadmusJiang authored Mar 25, 2021
1 parent a8adc57 commit 9506624
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/providers/check-issue/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ func (c *Check) ProcessPREvent(event *github.PullRequestEvent) {

func (c *Check) processIssue(URL string, issueID int, title string, body string) error {
if c.IsIncludeChinese(title) || c.IsIncludeChinese(body) {
e := c.addTemplate(issueID)
//e := c.addTemplate(issueID)
//if e != nil {
// err := errors.Wrap(e, "add template to comment fail")
// return err
//}
e := c.SendMessage(URL + " include chinese.")
if e != nil {
err := errors.Wrap(e, "add template to comment fail")
return err
}
e = c.SendMessage(URL + " include chinese.")
if e != nil {
err := errors.Wrap(e, "send wechat message fail")
err := errors.Wrap(e, "send feishu message fail")
return err
}

Expand Down Expand Up @@ -126,7 +126,7 @@ func httpPostJson(url string, data map[string]interface{}) (map[string]interface
defer resp.Body.Close()

var result map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&data)
err = json.NewDecoder(resp.Body).Decode(&result)
if err != nil {
return nil, err
}
Expand All @@ -136,9 +136,9 @@ func httpPostJson(url string, data map[string]interface{}) (map[string]interface

func (c *Check) SendMessage(content string) error {
req := map[string]interface{}{
"msgtype": "text",
"text": map[string]interface{}{
"content": content,
"msg_type": "text",
"content": map[string]interface{}{
"text": content,
},
}
data, err := ioutil.ReadFile("/root/github-bot/webhook.txt")
Expand Down

0 comments on commit 9506624

Please sign in to comment.