[英]How do I find the name of the room Hubot is responding to?
我正在写一个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
这就是你得到房间的方式:
room = msg.message.room
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.