From c418a5c6b8dd8632e46324c5ffc8c12dde4ce7b0 Mon Sep 17 00:00:00 2001 From: Andy Tudhope Date: Wed, 21 Mar 2018 10:51:32 +0200 Subject: [PATCH] Added Paid to: update protection --- bot/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bot/index.js b/bot/index.js index 04871df..80fa895 100644 --- a/bot/index.js +++ b/bot/index.js @@ -9,6 +9,7 @@ const github = require('./github') const winnerString = 'Winner:' const contractAddressString = 'Contract address: ' +const paidString = 'Paid to:' const logger = winston.createLogger({ level: 'info', @@ -38,10 +39,16 @@ function needsFunding (req) { return false } else if (hasWinner(req)) { return false + } else if (isPaid(req)) { + return false } return true } +function isPaid (req) { + return req.body.comment.body.search(paidString) !== -1 +} + function hasWinner (req) { return req.body.comment.body.search(winnerString) !== -1 }