Skip to content

helloleah/fleetwood-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fleetwood-slack

It's a Slack bot that sends you Fleetwood Mac lyrics.

Prerequisites:

Creating the Slack app:

  1. Go to https://api.slack.com/apps and click Create New App
  2. Name it and choose a workspace
  3. Add Scopes
    1. Go to OAuth & Permissions
    2. Under Bot Token Scopes, add permissions. For this app, we at least need app_mentions:read, which allows our app to view messages that directly mention our bot, and chat:write, which allows our app to send messages
  4. Scroll to the top of the OAuth & Permissions page and click Install App to Workspace

Set up the Bolt project:

  1. Clone the Github repo:
git clone https://github.com/helloleah/fleetwood-slack.git
cd fleetwood-slack
  1. I recommend setting up a virtual environment for dependency management:
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies: pip install -r requirements.txt
  2. Grab your Signing Secret from the Basic Information page and your Slack Bot Token from the OAuth & Permissions page, and store them in environment variables:
export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
  1. Run the Flask app: FLASK_APP=app.py FLASK_ENV=development flask run -p 3000

Set up ngrok and events:

  1. In a terminal, run ngrok: ngrok http 3000
  2. On Event Subscriptions page, enable events (if not already enabled)
  3. In request URL, put ngrok URL plus /slack/events, e.g. https://8eb44499712a.ngrok.io/slack/events
  4. Click Subscribe to Bot Events
  5. Click Add Bot User Event and add the app_mention event, which will subscribe to message events that mention our bot

Be sure to /invite the bot to a channel in your Slack workspace, then try @-mentioning the bot.

About

It's a Slack bot that sends you Fleetwood Mac lyrics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages