Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
add Github订阅
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoo committed Jun 1, 2021
1 parent d1568f3 commit dc3ea10
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions githubManager/hookManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,20 @@ func NewManager(app *iris.Application, bot *OPQBot.BotManager) Manager {
commitString = append(commitString, fmt.Sprintf("[%s] %s", v1.Timestamp, v1.Message))
}
r, _ := requests.Get(v.Sender.AvatarURL)
m.b.SendGroupPicMsg(h.Groups[0], fmt.Sprintf("%s\nCommit:\n%s", v.Repository.FullName, strings.Join(commitString, "\n")), r.Content())
for _, v1 := range h.Groups {
m.b.SendGroupPicMsg(v1, fmt.Sprintf("%s\nCommit:\n%s", v.Repository.FullName, strings.Join(commitString, "\n")), r.Content())
}
case github.ReleasePayload:
r, _ := requests.Get(v.Sender.AvatarURL)
m.b.SendGroupPicMsg(h.Groups[0], fmt.Sprintf("%s\n发布了:\n%s", v.Repository.FullName, v.Release.TagName), r.Content())
for _, v1 := range h.Groups {
m.b.SendGroupPicMsg(v1, fmt.Sprintf("%s\n发布了:\n%s", v.Repository.FullName, v.Release.TagName), r.Content())

}
case github.PullRequestPayload:
m.b.SendGroupTextMsg(h.Groups[0], fmt.Sprintf("%s\nPR: %s", v.Repository.FullName, v.PullRequest.Body))
for _, v1 := range h.Groups {
m.b.SendGroupTextMsg(v1, fmt.Sprintf("%s\nPR: %s", v.Repository.FullName, v.PullRequest.Body))
}

}
})
return m
Expand Down

0 comments on commit dc3ea10

Please sign in to comment.