mirror of
https://github.com/status-im/autobounty.git
synced 2025-01-12 14:55:09 +00:00
Added Paid to: update protection
This commit is contained in:
parent
e69d267cba
commit
c418a5c6b8
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user