Giter Club home page Giter Club logo

fleetwood-slack's Introduction

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.

fleetwood-slack's People

Contributors

helloleah avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.