Skip to content
This repository
Adam Stankiewicz February 19, 2013
file 24 lines (21 sloc) 0.449 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# Description:
# sandbox - run javascript in a sandbox!
#
# Dependencies:
# "sandbox": "0.8.3"
#
# Configuration:
# None
#
# Commands:
# hubot (run|sandbox) <javascript> - Execute the javascript code
#
# Author:
# ajacksified

Sandbox = require('sandbox')

module.exports = (robot) ->
  robot.respond /(run|sandbox|js) (.*)/i, (msg) ->
    sandbox = new Sandbox
    sandbox.run(msg.match[2], (output) ->
      msg.send output.result
    )
Something went wrong with that request. Please try again.