VRMS
VRMS copied to clipboard
Add Slack "Greet Bot" to direct new-joiners to create a profile
Overview
Upon joining the org Slack channels, a new user should be greeted with a bot that directs them to vrms.io to create a new profile
Action Items
Take a look here https://github.com/100Automations/futureautomations/issues/8
Copied from 100Automations issue 8:
Goal: Replace greet.bot with a new slack bot that can pull from csv file (Google docs) and markdown files: e.g., When to send (days they have been a member), time (when to send message), active(true/false), message file name e.g.
1, 10:01am, true, welcome.md
7, 10:01am, true, joinedlastweek.md
30, 10:01am, true, active30days.md
15, 10:01am, false, notactive15days.md
when script finishes running it should report to whichever handles are in a csv file e.g. @ bonnie, @ leader2, @ leader3, etc. as well as adding a successful or unsuccessful message to a log file in the repo.
Automation triggers (What starts it? What's it responding to?)
- Time-based (Specify frequency (e.g. 1x/week)
- Event-based (e.g. someone just created a new GitHub on a repo)
- The script will run once a day. Messages will be sent based on how long someone is a member and each will have a different date trigger as specified by the csv file.
Clarifying Questions
- What information specifically should the leaders be seeing in the log, or just a success/fail message? Will slackbot send them a message or a file?
Action Items
- [ ] set up Slackbot to send messages to users when they join/after 7, 15, 30 days
- [ ] Determine how to send info from slack to DB
- [ ] Connect to our team roster (mongoDB) using Node
- [ ] automate data population from slackbot to the DB
Resources https://medium.com/better-programming/make-a-team-roster-with-node-react-and-google-sheets-305b9f9ebbb1 https://api.slack.com/reference/surfaces/formatting https://api.slack.com/start/building/bolt-js https://api.slack.com/methods
Progress: I've set up the Bolt framework and have the live code working on Glitch (local development not set up yet), and also reading through docs to get more familiar with the slack APIs Blocks: reading through docs, many many docs ETA: Hoping I can at least get bot to read user's joined date and send message accordingly by next week Availability: Weekdays
Progress: I haven't made too much progress on the bot itself, mostly getting acquainted with the VRMS repo Blocks: setting up VRMS correctly and setting up slackbot to run from there ETA: Will unblock my blocks by next week's meeting 🧱 Availability: Weekdays
Some issues/ questions:
- in our demo user model on google drive, we have a 'createdDate', I'm assuming this is based on the date that they create a VRMS account?
- If so, do we still need to track the date they joined Slack? I ask mostly because tracking the current slack users would require slack's 'team_accessLog' API which is for paid accounts only, whereas 'team_joined' is an event API (listening for new users) and is free to use.
Progress: Bot can send messages to a specified user (via user slack ID)
Currently trying to get this to print from a markdown instead of manually including it inside a text block
Blocks: Will need to talk with Bonnie about slack bot specifics, and work with team to consolidate our bots onto VRMS dev branch
ETA: Will work out a time with the team to discuss
Availability: Weekdays
Progress: Bot can read (from a markdown file) and send messages and can also calculate how long user has been a member of a slack workspace (via slack user data) Blocks: Need a way to connect MongoDB data and slack data -- is email a sufficient primary/foreign key to use? Availability: limited this week, but I'll keep working on what I can
Progress: no additional updates Blocks: the slack devs had a meeting and we're anticipating to test our bots on the HFLA workspace - if we can receive admin access
Questions/Blocks :
- Should user's activity be tracked using first their user object (createdDate) and then reference their latest activity in the checkins model (using userId and createdDate of the event)?
- if available: markdown files with messages for newUsers
Progress: Slackbot is reading from the models, now I just need to create one more function for a list of users to send messages to (I'm thinking about using User model for User's account creation date and CheckIn Model for last date that user checked in -- this might change when we move to new models in the future....) Blocks: markdown files with messages for newUsers ETA: Aiming to create a PR this week Availability: open this week
@ye-susan please add an update
Progress: Need to make a few more adjustments to the function (changing around the way I do my querying to the db) Availability: Limited this week
Created PR: https://github.com/hackforla/VRMS/pull/382
I'll have to take some time off VRMS to focus on work, so I wanted to submit my PR with what I currently have.
Current functionality:
- query the db for user accounts that are <= 30 days old
- message user from markdown via Slackbot direct message
Improvements Needed:
- check if user has already attended meetings, so they won't receive the messages
- this slackbot is currently not linked to cron to be run daily
- need a way to determine that we've already messaged user so they won't receive message again
This work is being held on hold for the time being until we determine the best way to implement with the mvp.
@juliagab56