7

我正在编写一个 Hubot 脚本来连接我们工作中的跟踪系统。它应该触发带有各种参数的 PHP 脚本,然后该脚本会将响应发送到房间。

我怎样才能知道 Hubot 正在响应的消息来自哪个房间,以便我可以在我的 AJAX 请求中发送它?

这是我的脚本的样子:

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
4

1 回答 1

13

这是您获得房间的方式:

room = msg.message.room

于 2014-07-03T06:38:59.120 回答