Created
September 14, 2017 23:40
-
-
Save bkeepers/5f2545263e342575ac55741fa8414246 to your computer and use it in GitHub Desktop.
Probot app to delete 👍 and single emoji comments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :+1: comments and single emoji | |
const pattern = /^\W*(:[\w-\+]+:|[\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])\W*$/g; | |
module.exports = robot => { | |
robot.on('issue_comment.created', context => { | |
if(context.payload.comment.body.match(pattern)) { | |
context.github.issues.deleteComment(context.issue()); | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment