Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Probot app to delete 👍 and single emoji comments.
// :+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