Skip to content

CoffeeTime dev setup

vrk edited this page Sep 13, 2019 · 3 revisions

Setting up a dev environment

  1. Create a new Slack workspace at https://slack.com/get-started. This is where you'll install your test CoffeeTime bot for development.

  2. Remix CoffeeTime, then click "Show Live." The "live" website for the Slack bot is a step-by-step guide to installing your new test CoffeeTime on your test Slack.

  3. Follow all the instructions for "Botkit Starter Kit" on the live website. NOTE: There are a few additional required steps that are not listed here, which are described below!

    1. Under Event Subscriptions: Under Subscribe to Workspace Events, also include "app_uninstalled"

    2. Under Slash Commands: Click "Create New Command", then add:

      1. Command: /coffeetime
      2. Request URL: YOUR_APP_NAME.glitch.me/slack/receive
      3. Short description: "Summons CoffeeTime"
      4. Usage hint: "subscribe, unsubscribe, help"
  4. When you have filled out your .env file according to the instructions, the live page should change to say "I am a bot." Click the "Add to Slack" button.

  5. One last weird thing: You need to now reinstall CoffeeTime again from https://api.slack.com/apps -_- It's dumb, the slash command /coffeetime will not work until you've done this:

    1. Go to https://api.slack.com/apps and click into your test bot
    2. You should see a bar at the top of the page telling you to "click here" to reinstall the app
    3. Follow the prompts!

That should do it! Try running /coffeetime to see if it's working.

Tips for developing CoffeeTime

Add multiple users to the Slack

You can add test users to your Slack by inviting them using a plus alias for your Gmail address, like if your email is [email protected], you can add [email protected], [email protected], etc

Test the admin panel

You can access the admin panel by running /coffeetime admin. This lets you force-run CoffeeTime, add and remove subscribers, mass subscribe all users, etc

Triggering the Onboarding flow

  1. Uninstall the test app from your test Slack
  2. In your test app's Glitch env, open Console and:
cd .data
rm coffee.json
rm db/teams/*
refresh
  1. Reinstall the test app