commit
0ebda615f2
2 changed files with 10 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
package main
|
||||
|
||||
var version = "v0.01"
|
||||
var version = "v0.03"
|
||||
|
||||
func main() {
|
||||
initGitHubClient(version)
|
||||
|
|
18
bot/utils.go
18
bot/utils.go
|
@ -177,10 +177,11 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
|
|||
}
|
||||
|
||||
return
|
||||
} else {
|
||||
commentText := "Votes: (#{reactionCount})/(#{reactionCountGoal})"
|
||||
commentText = strings.Replace(commentText, "(#{reactionCount})", strconv.Itoa(len(approvals)), 1)
|
||||
commentText = strings.Replace(commentText, "(#{reactionCountGoal})", strconv.Itoa(reactionCountGoal), 1)
|
||||
}
|
||||
|
||||
if approvals[eventSender] > 1 {
|
||||
commentText := "@(#{commentAuthor}) your vote has already been counted :x:"
|
||||
commentText = strings.Replace(commentText, "(#{commentAuthor})", eventSender, 1)
|
||||
|
||||
// Respond with a comment
|
||||
comment := &github.IssueComment{
|
||||
|
@ -191,11 +192,10 @@ func processIssueCommentEvent(event *github.IssueCommentEvent) {
|
|||
if err != nil {
|
||||
log.Println("Error creating comment:", err)
|
||||
}
|
||||
}
|
||||
|
||||
if approvals[eventSender] > 1 {
|
||||
commentText := "@(#{commentAuthor}) your vote has already been counted :x:"
|
||||
commentText = strings.Replace(commentText, "(#{commentAuthor})", eventSender, 1)
|
||||
} else {
|
||||
commentText := "@(#{commentAuthor}) voted! :tada:\n" + "Votes: (#{reactionCount})/(#{reactionCountGoal})"
|
||||
commentText = strings.Replace(commentText, "(#{reactionCount})", strconv.Itoa(len(approvals)), 1)
|
||||
commentText = strings.Replace(commentText, "(#{reactionCountGoal})", strconv.Itoa(reactionCountGoal), 1)
|
||||
|
||||
// Respond with a comment
|
||||
comment := &github.IssueComment{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue