Skip to content

Commit

Permalink
upgrade docs
Browse files Browse the repository at this point in the history
  • Loading branch information
halkeye committed Aug 17, 2023
1 parent a525ad5 commit 26279b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 225 deletions.
196 changes: 0 additions & 196 deletions DEPLOY.md

This file was deleted.

10 changes: 2 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ alembic upgrade head
And run the application:

```
flask run
python app.py
```

#### Test
Expand All @@ -72,11 +72,5 @@ createdb glossary-bot-test
You can now run the tests from the command line:

```
python -m unittest
```

or run an individual test:

```
python -m unittest tests.test_bot.TestBot.test_get_definition
pytest
```
34 changes: 13 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,30 @@

Glossary Bot is a Slack bot that maintains a glossary of terms created by its users, and responds to requests with definitions.

It is a simple web app designed to be used as a [Slack integration](https://slack.com/integrations). Specifically, it responds to POSTs created by the Slack *Slash Commands* integration and responds with messages to Slack's *Incoming Webhooks* integration.
It is a simple web app designed to be used as a [Slack app](https://api.slack.com/apps/).

![DemoGif](https://raw.githubusercontent.com/codeforamerica/glossary-bot/master/static/gloss-bot-demo.gif)
![DemoGif](https://raw.githubusercontent.com/halkeye/glossary-bot/master/static/gloss-bot-demo.gif)

### Deploy Glossary Bot

Glossary Bot is a [Flask](http://flask.pocoo.org/) app built to run on [Heroku](https://heroku.com/). To deploy the bot using Heroku's automated setup, see below. To deploy or upgrade the bot from the command line, read [DEPLOY](DEPLOY.md). To install the bot locally for development and testing, read [INSTALL](INSTALL.md).
Glossary Bot is a [Slack Bolt](https://slack.dev/bolt-python/concepts/) app built to run on any hosting provider. Private or public. Digital Ocean Apps Platform instructions have been provided below. To install the bot locally for development and testing, read [INSTALL](INSTALL.md).

### Set Up on Slack

Glossary Bot uses two Slack integrations: [Slash Commands](https://api.slack.com/slash-commands) for private communication between the bot and the user, and [Incoming Webhooks](https://api.slack.com/incoming-webhooks) for posting public messages.
Glossary Bot uses the new socket support, so it is very easy to setup.

[Set up a Slash Command integration](https://my.slack.com/services/new/slash-commands). There are three critical values that you need to set or save: **Command** is the command people on Slack will use to communicate with the bot. We use `/gloss`. **URL** is the public URL where the bot will live; **LEAVE THIS PAGE OPEN** so that you can fill this in after you've deployed the application to Heroku, as described below. **Token** is used to authenticate communication between Slack and the bot; save this value for when you're setting up the bot on Heroku.
First [create a new app](https://api.slack.com/apps?new_app=1) by copying the [manifest.json](./manifest.json) into the manifest text box.

[Set up an Incoming Webhooks integration](https://my.slack.com/services/new/incoming-webhook). The first important value here is **Post to Channel**, which is a default channel where public messages from the bot will appear. This default is always overridden by the bot, but you do need to have one – we created a new channel called *#glossary-bot* for this purpose. Save the value of **Webhook URL**; this is the URL that the bot will POST public messages to, and you'll need it when setting up Gloss Bot on Heroku.
### Deploy on Digital Ocean

### Deploy on Heroku
[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/halkeye/glossary-bot/tree/master)

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
Click the button above to get started. In the form that loads, add a name for your bot in the **App Name** field, or leave it blank to have Digitalocean generate a unique name. You won't see this name in Slack, it'll just be part of the URL that Slack uses to communicate with the bot behind the scenes.

Click the button above to get started. In the form that loads, add a name for your bot in the **App Name** field, or leave it blank to have Heroku generate a unique name. You won't see this name in Slack, it'll just be part of the URL that Slack uses to communicate with the bot behind the scenes.
From the [Build Apps](https://api.slack.com/apps/) screen:

Paste the **Token** from the Slash Command integration into the `SLACK_TOKEN` field and the **Webhook URL** from the Incoming Webhooks integration into the `SLACK_WEBHOOK_URL` field. Now click the **Deploy for Free** button to deploy the bot!
1) copy the **Signing Secret** into `SLACK_SIGNING_SECRET` variable.
2) Click **Generate Token and Scopes**. Make sure `connections:write` and `authorizations:read` scopes are set. Copy this into `SLACK_APP_TOKEN` variable in Digital Ocean
3) Click **OAuth && Permissions**. Copy the `Bot User OAuth Token` and paste the token into `SLACK_BOT_TOKEN` variable in Digital Ocean

When it's done deploying, click the **View** button at the bottom of the form. A **Method Not Allowed** error page will load, but don't worry about that. All you're looking for is your bot's URL, which looks something like `https://my-glossary-bot.herokuapp.com/`. Copy that URL, paste it into the **URL** field of the Slash Command integration page on Slack, and save the integration there.

And now you're good to get glossing! Open up Slack and type `/gloss help` to start.

If you installed Gloss Bot on Heroku using the Deploy on Heroku button and you want to upgrade it with the latest changes, [follow these instructions](DEPLOY.md#upgrade-on-heroku).

---

#### Learn about Code for America

Code for America believes government can work for the people, and by the people, in the digital age, starting with the people who need it most. We build digital services that enhance government capabilities, and we help others do the same across all levels of government. We organize thousands of volunteers across nearly 80 chapters nationwide who improve government in their local communities. Our goal: a 21st century government that effectively and equitably serves all Americans. Learn more at [codeforamerica.org](https://codeforamerica.org).
And now you're good to get glossing! Open up Slack and type `/glossary help` to start.

0 comments on commit 26279b4

Please sign in to comment.