codebuddies / greetbot

Slackbot for greeting new codebuddies users
MIT License
9 stars 14 forks source link

Add New `/events` Listener and Endpoint for #introduce-yourself Channel #17

Open BethanyG opened 6 years ago

BethanyG commented 6 years ago

Thinking it would be nice to have our greetbot do a listen for channel_join in #introduce-yourself, and respond with a welcome and a prompt to talk about where the user is from, and what they're learning/doing.

Something along the lines of:

Hi @user - We're glad you're here. :dancing-penguin: Tell us a little about yourself: What you are working on, & what are you learning? We'd love to hear about it!

Steps Needed: (ask an admin if you don't have access to the Slack API for staging...or use your own Slack team /account)

1) Subscribe to the member_joined_channel event in the Slack API 2) Add a Bot User Event member_joined_channel for the #introduce-yourself channel 3) Add a generic method under routes/events that parses out which event is incoming (initial welcome vs channel_join vs something else), & passes the call to the destination method. 4) Change index.js to point to the generic method for routes/events 5) Add method under routes/events to handle the member_joined_channel event that will compose and send the appropriate message for member_joined_channel #introduce-yourself 6) Add message for the #introduce-yourself response 7) Make sure that the generic method to parse /events knows about the initalWelcome event, and will route that event accurately. 8) Add tests for the above