Add MAC addresses in bots response#5
Add MAC addresses in bots response#5suyashmahar wants to merge 3 commits intomdgspace:masterfrom suyashmahar:feat/presence
Conversation
scripts/wail.coffee
Outdated
| "fallback": "Here's a pic: #{waliUrl}" | ||
| "color": "#36a64f" | ||
| "pretext": "Here's a pic:" | ||
| "pretext": "#{resp} \n Here's a pic:" |
There was a problem hiding this comment.
msg.send will be sent before the resp is fetched, since request.get makes an asynchronous call.
So it will send empty message to slack.
scripts/wail.coffee
Outdated
| resp = body | ||
|
|
||
| msg.send( | ||
| "attachments": [ |
There was a problem hiding this comment.
please test the script locally once, I sense there's some indentation error.
scripts/wail.coffee
Outdated
| "fallback": "Here's a pic: #{waliUrl}" | ||
| "color": "#36a64f" | ||
| "pretext": "Here's a pic:" | ||
| "pretext": "#{resp} \n Here's a pic:" |
There was a problem hiding this comment.
Add the complete message to fallback too. In case the attachment message fails, slack displays the fallback text.
There was a problem hiding this comment.
when it fails, will the response be null?
scripts/wail.coffee
Outdated
| msg.send( | ||
| "attachments": [ | ||
| robot.respond /who.*lab/i, (msg) -> | ||
| waliUrl = process.env.WAIL_PIC_URL + '?t=' + new Date().getTime() |
There was a problem hiding this comment.
Please correct the typo, wali wail .
scripts/wail.coffee
Outdated
| "attachments": [ | ||
| robot.respond /who.*lab/i, (msg) -> | ||
| waliUrl = process.env.WAIL_PIC_URL + '?t=' + new Date().getTime() | ||
| wailTextUrl = process.env.WAIL_NAME_URL + '?t=' + new Date().getTime() |
There was a problem hiding this comment.
Add WAIL_NAME_URL to the configuration on the top of this script.
scripts/wail.coffee
Outdated
| waliUrl = process.env.WAIL_PIC_URL + '?t=' + new Date().getTime() | ||
| wailTextUrl = process.env.WAIL_NAME_URL + '?t=' + new Date().getTime() | ||
|
|
||
| request = require 'request' |
There was a problem hiding this comment.
There's no request package defined in dependencies in package.json. Instead you could use robot.http() to make a http call. Check here.
|
should I merge this @csoni111 ? |
No description provided.