【发布时间】:2018-03-26 05:51:58
【问题描述】:
我最近安装了hubot并正在测试它。
现在我看到了。我不明白:
鉴于此代码(hubot-maps 的一部分 - maps.coffee file)
robot.respond /(?:(satellite|terrain|hybrid)[- ])?map( me)? (.+)/i, (msg) ->
mapType = msg.match[1] or "roadmap"
location = encodeURIComponent(msg.match[3])
mapUrl = "http://maps.google.com/maps/api/staticmap?markers=" +
location +
"&size=400x400&maptype=" +
mapType +
"&sensor=false" +
"&format=png" # So campfire knows it's an image
url = "http://maps.google.com/maps?q=" +
location +
"&hl=en&sll=37.0625,-95.677068&sspn=73.579623,100.371094&vpsrc=0&hnear=" +
location +
"&t=m&z=11"
msg.send mapUrl
msg.send url
为什么我会收到这样的回复
我先在哪里得到url,然后是mapUrl?
我希望先得到mapUrl,然后是url
【问题讨论】:
标签: javascript node.js coffeescript hubot