-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MAC addresses in bots response #5
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.