From a5eaa40fc63af270636edbd7df4e97913b9dd7c2 Mon Sep 17 00:00:00 2001 From: James Date: Sun, 6 Oct 2019 09:47:27 +0100 Subject: [PATCH] add cleanup script to remove all the bot spam! --- src/cleanup.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/cleanup.php diff --git a/src/cleanup.php b/src/cleanup.php new file mode 100644 index 0000000..3ce8aa9 --- /dev/null +++ b/src/cleanup.php @@ -0,0 +1,26 @@ +#!/usr/bin/php +getIssues(['q'=>$word]) as $issue){ + // loop through the current issues comments + foreach($issue->getComments() as $comment){ + // if the comment body matches + if(($comment->user->login=='Bot') && (strpos($comment->body,$word)!==false)){ + // delete the commend + $repo->deleteComment($comment); + } + } + } +}