I'm writing a Hubot script to connect with our tracking system at work. It should be triggering a PHP script with various parameters, and then that script will send the response into the room.
How can I tell which room the message that Hubot is responding to came from, so I can send it in my AJAX request?
This is what my script looks like:
module.exports = (robot) ->
robot.hear /RT \d+$/, (msg) ->
ticket = msg.match[1]
msg.send "test"
$.ajax 'YourScriptHere',
data :
room : room // This is what I need to find.
ticket : ticket
This is how you get the room:
room = msg.message.room
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With