https://github.com/vapor-community/slack-bot
An example Slack Bot application built with Vapor in Swift.
https://github.com/vapor-community/slack-bot
Last synced: 6 months ago
JSON representation
An example Slack Bot application built with Vapor in Swift.
- Host: GitHub
- URL: https://github.com/vapor-community/slack-bot
- Owner: vapor-community
- Created: 2016-07-02T00:50:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T10:20:28.000Z (over 8 years ago)
- Last Synced: 2025-04-29T08:54:10.296Z (6 months ago)
- Language: Swift
- Homepage:
- Size: 303 KB
- Stars: 75
- Watchers: 8
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vapor SlackBot
You'll probably want to start w/ the slack documentation: https://api.slack.com/bot-users.
You can come say hello to this bot running on heroku in our slack as myrtle: http://slack.qutheory.io/
## 🦄 Deploy
[](https://heroku.com/deploy)
#### ⚠️ Note
Heroku won't automatically scale dynos for your bot. After the build is complete, you'll need to start the process.

## 🚦 Environment
| Xcode | Swift Version |
|:-:|:-:|
| 8 | DEVELOPMENT-SNAPSHOT-2016-06-20-a |Setup Xcode by running `swift package generate-xcodeproj`
### 🔑 Bot Token
Once you have setup your bot-token, create a folder named `Config` and place a file `bot-config.json` in it. The green check marks are because I sync w/ Dropbox, they can be ignored.

Your `bot-config.json` file should look like this (replace your token)
```
{
"token": "<#your token here#>"
}
```## 🏃 Run
Once the environment is configured, as above, your bot should run in Xcode. Direct message your bot in slack w/ a `hello` prefix and there will be a hello response.
## 🛠 Manually Deploy
If you'd prefer to build to Heroku manually
#### Config Token
Add your secret token (or through Heroku WebSite):
```
heroku config:set BOT_TOKEN=<#your-token-here#>
```#### Set Buildpack
```
heroku buildpacks:set https://github.com/kylef/heroku-buildpack-swift
```#### Procfile
Already included in project, should be `worker` type.
#### Push To Heroku
Commit uncommmitted changes if necessary, then push to Heroku
```
git push heroku master
```#### Scale Up Dyno
Scale up a worker with:
```
heroku ps:scale worker=1
```### Author
Created by Logan Wright