OSU-Auto-Mod
The Auto Mod bot implementation for the OSU Online CS Post bacc slack community
What does this bot do?
Currently, the Auto Mod bot on the OSU Online Post Bacc CS slack doesn't do much. It tells the admins when a new channel has been created, and that's about it. This project is an adaptation of the Slack API terms of service bot open source project. We are looking to add a number of features to the Auto Mod in order to make our community more inclusive & dynamic as it continues to grow. This includes anonymous reporting, welcome messages, terms of service signing, etc.
Contribution guidelines
Please refer to the CONTRIBUTING.md file for the guidelines!
Getting started
There are several steps required to get the slack bot up and running for local development (if you think there is a way to optimize this, submit an issue!)
Development Slack
- Create an account on the development slack instance - this can be found here
- Send a message to @John McBride for admin access & collaborative permissions to the development slack
Node JS dependencies & Local Development
- Install ngrok globally. A nice tutorial can be found here on how ngrok works and why it makes local development of slack apps possible
- Pull this github repository code
- Run
npm install
to download the project dependencies
Environment Variables
- Once you are on the development slack and you have admin access, enter the admin pannel and go to the Slack API webpage. It can also be found here - Enter the page for the Auto Mod test bot
- Create a NEW file in the root of your project files named
.env
exactly - Under the
OAuth & Permissions
tab, copy theBot User OAuth Access Token
- Use this token as the
SLACK_TOKEN
environment variable in.env
- Under the
Basic Information
tab, copy theVerification Token
- Use this token as the
SLACK_VERIFICATION_TOKEN
environment variable in.env
- Specify a
PORT
environment variable (I usually do 8080)
NOTE: Check out .env.sample
for how this environment variable file should look!
Run the app locally!
- Start the app with
npm start
- In another terminal window, start ngrok on the same local port you specified in
.env
like this:ngrok http 8080
- This allows your local instance of the node microservice to be tunneled through the internet to the slack API!
Configure the Slack API
- Back on the Slack API app web page, navigate to the
Events Subscriptions
- Under the Request URL, change the URL to
http:// xxx.ngrok.io/events
(see your ngrok instance for the specific tunnel that your node instance can be reached on) - Ensure that the app is verified. You're all good to go!!
NOTE: If two people are attempting to develop at the same time, on the same development slack workspace, this process will NOT work. If you run into these issues, you may need to create your own development slack workspace! This would require a few additionally steps, so head over to #auto_mod and let the projects owners know if there are slack ngrok collision issues!
Local development roadmap
In the future, all contributors will be required to have their own development slack workspaces. As the project grows, we will begin to use the OSU-Auto-Mod slack as a "production test" envrionment before pushing up changes to the bot in the actual "production" enviroment (aka, the OSU Post Bacc slack).
Community guidelines
All contributors must follow the OSU student code of conduct
Where to get help
Join the #Auto_Mod channel on the OSU Online CS Post Bacc slack found at https://osu-cs.slack.com/ Note: You MUST have an @oregonstate.edu email to sign up for this slack
Current Project Owners
John McBride
OSU Slack: @John McBride
Email: mcbridej@oregonstate.edu
Hunter Schallhorn
OSU Slack: @schallhh
Email: schallhh@oregonstate.edu