Installation - SubparLabs/pluspl.us GitHub Wiki

Install Instructions

(Instructions adapted from here)

  1. Create a new app in your Slack team.

    You can do this from the Slack API Apps page. You'll need permission to add new apps, which depending on your team settings might require an admin to do it for you.

  2. Add a bot user for your app.

    This can be done under Bot Users in the menu on the left. You can name it whatever you like, and for best results, select it to always show as online.

    This allows the app to speak back to your team when they ++ and -- things.

  3. Add chat permissions, and install the app.

    Under OAuth & Permissions, scroll down to Scopes and add the chat:write:bot permission. Click Save Changes.

    You can now install the app. Scroll back up, click Install App to Workspace, and follow the prompts.

  4. Add a redirect URL

    Under the OAuth & Permissions section, scroll down to Redirect URLs and add the following URL: <your_domain_name.com>/slack/callback

  5. Copy your tokens.

    From the same Basic Information page, store the following tokens (you'll need them to setup the app on Heroku):

    • The Client ID
    • The Client Secret
    • The Signing Secret

    From the Manage Distribution page, stor the Shareable URL.

  6. Register for Sentry.io

    Register your new application at Sentry.io to provide error logging. It will generate a url that will be needed to install this app.

  7. Deploy the app to Heroku.

    Deploy to Heroku

    This app was designed for Heroku, and shouldn't cost much to operate there. You may have to put in a credit card to increase the number of free hours alloted per month, though. Input the tokens and URL you collected in the previous step to the Heroku configuration to properly set up the app.

  8. Back at Slack apps, switch on Event Subscriptions for your app.

    Via Event Subscriptions in the left menu. After switching on, enter your new Heroku app address - eg. https://your-domain.herokuapp.com/slack/event - as the request URL.

    Scroll down and, under Subscribe to Bot Events, select the relevant events for the features you want the app to support:

    • Select message.channels to support all general features in public channels it is invited to.
    • Select message.groups to support all general features in private channels it is invited to.
    • Select message.im to support receiving commands by private message.

    Finally, click Save Changes. If you wish, you can come back to this screen later and add or change the events the app handles.

  9. Init the dB model in Heroku. Go to the plusplus directory in Heroku instance (For more see here):

$ FLASK_APP=app.py flask shell
Python 3.9.0 (default, Oct  6 2020, 15:19:54)
[GCC 9.3.0] on linux
App: plusplus.app [production]
Instance: /app/instance
>>> from plusplus.models import db
>>> db.create_all()
  1. Invite your new bot to any channel in your Slack team and use it.

    /invite @yourplusplus2bot

    @jake++