Javascript 回复。发送谅解?(胡伯特脚本)
我最近安装了hubot并正在测试它 现在我看到了我不明白的东西: 给定此代码(作为-maps.coffee的一部分) 为什么我会得到这样的回应 我首先从哪里得到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函数,
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),但出现了错误。你能帮我吗?