-
Notifications
You must be signed in to change notification settings - Fork 24
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
Added app.json, to allow for one click installation in Heroku #9
base: latest
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "Wheelie Slack App", | ||
"description": "Wheelie is a Slack App originally written for WeAllJS.com.", | ||
"repository": "https://github.com/WeAllJS/wheelie-slack-app", | ||
"keywords": ["node", "express", "slack", "bot"], | ||
"env": { | ||
"SEND_WELCOME_MESSAGE": { | ||
"description": "If the value of is 'FALSE', no message will be sent to new members when they join " | ||
}, | ||
"WELCOME_MESSAGE_TEXT": { | ||
"description": "A message that will be send to new members once they join the group" | ||
}, | ||
"SLACK_CLIENT_ID" : { | ||
"description": "" | ||
}, | ||
"SLACK_CLIENT_SECRET" : { | ||
"description": "" | ||
}, | ||
"VERIFICATION_TOKEN" : { | ||
"description": "" | ||
} | ||
} | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
const slack = require('slack') | ||
const bluebird = require('bluebird') | ||
const chat = bluebird.promisifyAll(slack.chat) | ||
|
||
const cocTxt = process.env.COC_URL ? `<${process.env.COC_URL}|Code of Conduct>` : 'Code of Conduct' | ||
const welcome_message_text = process.env.WELCOME_MESSAGE_TEXT || `Welcome! Review the ${cocTxt} before participating in the community.` | ||
const send_welcome_message = process.env.SEND_WELCOME_MESSAGE === 'FALSE' ? false : true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to figure out a way to make this configurable per-Slack, by Admins. I've been considering adding an admin-only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, I realized that later, this would be global config for everyone? how are you currently managing configurations per team, I can change it so it uses that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have a way to do that right now, which kinda sucks but was in my mental to-do list for Soon™. You did the bulk of the work for this feature too so what I meant is that we could merge this with default messages, and then customize it once the feature is up. I'm still not sure what the best way to do that is. |
||
|
||
module.exports = (data, cb) => { | ||
console.log('new user joined team: ', data) | ||
cb() | ||
if (!send_welcome_message || !welcome_message_text) { | ||
return cb() | ||
} | ||
chat.postMessageAsync({ | ||
token: data.token, | ||
channel: data.user.id, | ||
text: welcome_message_text | ||
}).then(() => { | ||
return cb() | ||
}) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,9 @@ | |
}, | ||
"engines": { | ||
"node": "5.9.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.8.1", | ||
"eslint-plugin-react": "^6.4.1" | ||
} | ||
} |
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.
How do you feel about filling in these descriptions?
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.
I don't know what exactly goes there, would you mind helping with that text, I don't wanna confuse the users.
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.
I can separate the things into two different PRs too, they're not really the same feature.
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.
They're basically application-level tokens. This isn't really a blocker either so don't worry about it. They're used by Slack to identify and authenticate applications, and there verification token is for authenticating individual requests -- these are simply things you grab from slack