Zomis / Duga

Stack Exchange Chat bot
18 stars 6 forks source link

Post comment content on pull requests #108

Open Zomis opened 9 years ago

Zomis commented 9 years ago

HookStringification.groovy:

void pull_request_review_comment(List<String> result, def json) {
    result << format(json, "%repository% %sender% [commented on **$json.comment.path**]($json.comment.html_url) of pull request ${issue(json.pull_request)}");
}

This does not post the content of the comment, only that there is a comment.

Compare with:

void issue_comment(List<String> result, def json) {
    String issue = issue(json.issue)
    String commentTarget = (json.issue.pull_request == null) ? "issue" : "pull request";
    result << format(json, "%repository% %sender% [commented]($json.comment.html_url) on $commentTarget $issue");
    result.add('> ' + truncate(json.comment.body))
    stats.addIssueComment(json.repository)
}
Zomis commented 8 years ago

It seems like comment content are included: http://chat.stackexchange.com/transcript/message/27428181#27428181 . Perhaps pull_request_review_comment only occurs when using the Github API and not when using the webhooks?

Zomis commented 8 years ago

According to Mug, when used as a webhook it is X-GitHub-Event: issue_comment