diff --git a/scripts/shell.coffee b/scripts/shell.coffee index 4248017..84d0fb0 100644 --- a/scripts/shell.coffee +++ b/scripts/shell.coffee @@ -12,10 +12,14 @@ cp = require 'child_process' -nope = ['BZBZ 400-BAD-REQUEST', 'BZBZ DOES-NOT-COMPUTE', 'BZBZ ADMIN-NOT-DETECTED', 'BZBZ IS-NOT-AUTHORIZED', 'BZBZ ACCESS-DENIED'] +nope = ['BZBZ 400-BAD-REQUEST', 'BZBZ DOES-NOT-COMPUTE', + 'BZBZ ADMIN-NOT-DETECTED', 'BZBZ IS-NOT-AUTHORIZED', + 'BZBZ ACCESS-DENIED'] isFromAdmin = (res) -> - res.message.user.room is process.env.ADMIN_ROOM?.replace(':','#') or res.robot.adapterName is 'shell' + res.robot.adapterName is 'shell' or + res.message.user.room is process.env.ADMIN_ROOM?.replace(':','#') + runCmd = (cmd,res,cb) -> if res?.send? then res.send 'operazione in corso: '+cmd