https://github.com/ifvictr/cheese
đź§€ The Cheese Touch, but over Slack
https://github.com/ifvictr/cheese
cheese-touch fun slack
Last synced: 10 months ago
JSON representation
đź§€ The Cheese Touch, but over Slack
- Host: GitHub
- URL: https://github.com/ifvictr/cheese
- Owner: ifvictr
- License: mit
- Created: 2020-07-24T04:42:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-04T09:04:24.000Z (almost 6 years ago)
- Last Synced: 2024-06-19T11:29:30.891Z (about 2 years ago)
- Topics: cheese-touch, fun, slack
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# đź§€ Cheese

The Cheese Touch, but over Slack. Idea taken from [Diary of a Wimpy Kid](https://diary-of-a-wimpy-kid.fandom.com/wiki/Cheese_Touch). Why did I make this? Besides having a reason to practice Go, I have no clue. 🤷‍♂
## Setup
### Creating the Slack app
You’ll need to create a Slack app (not a classic one) with at least the following bot token scopes. The reasons each scope is required are also included:
- `channels:history`: Used to check if a new user sent a message to pass the cheese touch. Only works if the app has been invited to the channel.
- `chat:write`: Used for sending messages when the cheese touch starts or gets passed to someone else.
- `groups:history`: Used to check if a new user sent a message to pass the cheese touch. Only works if the app has been invited to the channel.
- `reactions:read`: For listening to users that “touch” the cheese via reaction.
Then you’ll need to subscribe the app to a few events. The server has an endpoint open at `/slack/events`, so when you’re asked for a request URL, just put `https:///slack/events`. Only the following events are needed:
- `message.channels`
- `message.groups`
- `reaction_added`
### Environment variables
Here are all the variables you need to set up, with hints.
```bash
# Port to run the app server on
PORT=3000
# Redis database to record the user with the cheese touch
REDIS_URL=redis://…
# App config. Obtained from the "Basic Information" page of your app.
SLACK_BOT_TOKEN=xoxb-…
SLACK_VERIFICATION_TOKEN=xxxx…
```
### Deploying
```bash
# Run it
make
# Run it explicitly from a binary
make build
./bin/cheese
```
After you’ve followed all the above steps, you should see something like this:
```bash
Starting Cheese…
Listening on port 3000
```
Enjoy! đź§€
## License
[MIT License](LICENSE.txt)