diff --git a/index.js b/index.js index 666aa67..0fb3eae 100644 --- a/index.js +++ b/index.js @@ -74,6 +74,8 @@ function conjugatePast(verb) { return verb + (verb.substr(-1) === 'e' ? '' : 'e') + 'd'; } +var lastIssueActions = {}; + var handlers = { push: function(body, say) { @@ -132,6 +134,11 @@ var handlers = { if (issue.action === 'update') return; + // Don't trigger several close event. + if (issue.action === lastIssueActions[issue.iid]) + return; + lastIssueActions[issue.iid] = issue.action; + var displayedAction = conjugatePast(issue.action); shortenURL(url, function(shortUrl) {