Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 回复。发送谅解?(胡伯特脚本)_Javascript_Node.js_Coffeescript_Hubot - Fatal编程技术网

Javascript 回复。发送谅解?(胡伯特脚本)

Javascript 回复。发送谅解?(胡伯特脚本),javascript,node.js,coffeescript,hubot,Javascript,Node.js,Coffeescript,Hubot,我最近安装了hubot并正在测试它 现在我看到了我不明白的东西: 给定此代码(作为-maps.coffee的一部分) 为什么我会得到这样的回应 我首先从哪里得到url,然后是mapUrl 我希望先从中获取mapUrl,然后从中获取url,看起来Hubot会运行您的msg。异步发送s,因此没有保证顺序 作为一个副作用,侦听器现在是异步执行的。行为 在message.done前后应保持不变(流程直到message.done 是真的) 如果希望在url之前使用mapUrl,可以查看中的send函数,

我最近安装了hubot并正在测试它

现在我看到了我不明白的东西:

给定此代码(作为-maps.coffee的一部分)

为什么我会得到这样的回应

我首先从哪里得到
url
,然后是
mapUrl

我希望先从中获取
mapUrl
,然后从中获取
url

,看起来Hubot会运行您的
msg。异步发送
s,因此没有保证顺序

作为一个副作用,侦听器现在是异步执行的。行为 在message.done前后应保持不变(流程直到message.done 是真的)

如果希望在
url
之前使用
mapUrl
,可以查看中的send函数,该函数接受有序字符串列表

// Public: Posts a message back to the chat source
//
// strings - One or more strings to be posted. The order of these strings
//           should be kept intact.
//
// Returns nothing.
send (/* ...strings */) {
  const strings = [].slice.call(arguments)
  this.runWithMiddleware.apply(this, ['send', { plaintext: true }].concat(strings))
}
从中,看起来Hubot异步运行您的
msg.send
s,因此没有保证顺序

作为一个副作用,侦听器现在是异步执行的。行为 在message.done前后应保持不变(流程直到message.done 是真的)

如果希望在
url
之前使用
mapUrl
,可以查看中的send函数,该函数接受有序字符串列表

// Public: Posts a message back to the chat source
//
// strings - One or more strings to be posted. The order of these strings
//           should be kept intact.
//
// Returns nothing.
send (/* ...strings */) {
  const strings = [].slice.call(arguments)
  this.runWithMiddleware.apply(this, ['send', { plaintext: true }].concat(strings))
}

令人惊叹的!!非常感谢。我对JS不是很专业。我试着只调用msg.sen(mapUrl,url),但出现了错误。你能帮我吗?太棒了!!非常感谢。我对JS不是很专业。我试着只调用msg.sen(mapUrl,url),但出现了错误。你能帮我吗?