-
Notifications
You must be signed in to change notification settings - Fork 244
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
Allow user to create hangouts from slack #943
Allow user to create hangouts from slack #943
Conversation
@@ -1,18 +1,24 @@ | |||
var bodyParser = require('body-parser'); | |||
var bodyParser = require("body-parser"); | |||
import webhooks from "/server/slack/webhooks.js"; |
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.
eslint problems? ping @distalx
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.
server/routes.js
Outdated
result | ||
) { | ||
if (err) { | ||
res.statusCode = 404; |
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.
404 is reserved for page not found. not sure, but I think for a server side error, we should use 500
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.
@sebbel +1
server/slack/webhooks.js
Outdated
const { slackAppToken } = Meteor.settings; | ||
|
||
if (!token || token !== slackAppToken) { | ||
res.statusCode = 404; |
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.
see above
server/slack/webhooks.js
Outdated
webhooks.processEvent(event); | ||
return; | ||
} | ||
res.statusCode = 404; |
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.
see above
server/slack/webhooks.js
Outdated
processEvent(event) { | ||
console.log("webhook.processEvent", event); | ||
const { user: slackUserId, text, type, channel, ts } = event || {}; | ||
if (type !== "message") return; |
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.
eslint should throw here ping @distalx
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.
@sebbel Do we use any style guide for codebuddies? I can't find any eslint config.
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.
@sebbel What do you mean by eslint throwing here? Throwing an error?
@gauravchl We have https://docs.codebuddies.org/code-contribution/coding_style, and Prettier does automatically updates the code in the PR to be a certain style. Let me know if you need help with any of the remaining tasks!
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.
@lpatmo Thanks Linda! I will tackle remaining tasks this weekend, i might need some help with setting up slack app on production env.
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.
@gauravchl Thanks, sounds great! I will be working on CB too this weekend. Re: hosting -- were you thinking something like a DigitalOcean droplet? We should have funds still in our DigitalOcean account from the DO sponsorship. That's where we're hosting https://github.com/codebuddies/greetbot at the moment. (Not sure if it's possible to build on top of greetbot for the purposes of this integration.)
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.
@lpatmo Cool! Re Hosting: Naah, it doesn't need any extra droplet or server. It will run directly inside Meteor server where codebuddies.org is running. Just need to add some new keys(slack app tokens) inside settings-production.json
, i'll PM you. And then install the bot on codebuddies slack channel.
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.
Ah, that makes sense. I can def. add keys to both settings-development.json (so we can test it out) and then to settings-production.json for the release.
@sebbel Thanks for the review! |
@lpatmo @sebbel How to test on development machine
How to deploy to production
|
https://www.youtube.com/watch?v=eDrZC0uv8hA&feature=youtu.be is super exciting. Thanks for recording the demo! An idea/suggestion: After a hangout is successfully created, could the return message on Slack could contain the URL to the hangout that was just created? This way, the user could get to it to edit the details about the hangout, assuming they're logged into the site already. So the message might say: I'm assuming that the payload from the site could include the post ID that's created, of course. If the URL isn't possible, we could say something like: |
@lpatmo done 😎 |
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.
👍 🎆 🔥
Flow:
Links: