secret-kill-code requires admin perm now

This commit is contained in:
rnhmjoj 2015-06-22 17:25:55 +02:00
parent ea815ffc94
commit 12266b1842
2 changed files with 8 additions and 5 deletions

View File

@ -80,4 +80,3 @@ module.exports = (robot) ->
robot.hear /(?:ehi|ciao|we|(?:bella(?: li)?)) (?:asjon|assa|assion(?:i|e))/i, (res) ->
saluti = ['ciao', 'bella', 'è arrivato', 'eccolooo', 'dimmi', 'weeee', 'ehilà']
res.send res.random(saluti)+' '+res.message.user.name+'!'
robot.respond /secret-kill-code/i, (res) -> process.exit 0

View File

@ -44,21 +44,25 @@ module.exports = (robot) ->
robot.send r, 'asjon avviato e operativo!'
robot.respond /aggiornati|scarica (?:gli )?aggiornamenti/i, (res) ->
if !isFromAdmin(res) then return res.send res.random nope
return res.send res.random nope unless isFromAdmin(res)
runCmd 'git pull && npm install', res
robot.respond /(?:controlla gli )?aggiornamenti/i, (res) ->
if !isFromAdmin(res) then return res.send res.random nope
return res.send res.random nope unless isFromAdmin(res)
runCmd 'git fetch && git status', res
robot.respond /(?:installa (?:le )?)?dipendenze/i, (res) ->
if !isFromAdmin(res) then return res.send res.random nope
return res.send res.random nope unless isFromAdmin(res)
runCmd 'npm install', res
robot.respond /(?:esegui (?:i )?)?test/i, (res) ->
if !isFromAdmin(res) then return res.send res.random nope
return res.send res.random nope unless isFromAdmin(res)
runCmd 'npm test', res
robot.respond /secret-kill-code/i, (res) ->
return res.send res.random nope unless isFromAdmin(res)
process.exit 0
robot.on 'githubhook', (data,params) ->
if data.ref is 'refs/heads/master' and process.env.AUTO_KILL_ON_UPDATE
dest = name: params.name, room: params.room.replace(':','#')