https://github.com/wr46/slack-bot-server
A simple slack bot server template in Go
https://github.com/wr46/slack-bot-server
bot hacktoberfest slack
Last synced: 2 months ago
JSON representation
A simple slack bot server template in Go
- Host: GitHub
- URL: https://github.com/wr46/slack-bot-server
- Owner: wr46
- License: mit
- Created: 2019-05-15T09:49:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T22:32:40.000Z (over 3 years ago)
- Last Synced: 2024-06-20T13:38:35.227Z (about 2 years ago)
- Topics: bot, hacktoberfest, slack
- Language: Go
- Homepage:
- Size: 6.42 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# slack-bot-server
[](#contributors-)
A simple slack bot server template in Go for messaging
## Introduction
This project is a simple [Go](https://golang.org/) server application for a Slack Bot. \
The main goal here was to implement a Bot that answer to users in same workspace, by direct chat (user<>bot) \
or mention the bot in workspace channels.
## Implemented features
- **Show all available commands**
- **Do a vacation request**
- **Tell a joke**
- **Run a local script**
## Usage
In order for the server to work, you need to setup a '.env' file, you can use 'example.env' as a template.
```javascript
# NGROK
NGROK_AUTH=YOUR NGROK TOKEN
NGROK_PORT=botapp:3000
NGROK_REGION=eu
# Application
DEBUG=true
# Slack
BOT_USER_OAUTH_ACCESS_TOKEN=YOUR BOT USER OAUTH ACCESS TOKEN
VERIFICATION_TOKEN=YOUR APP VERIFICATION TOKEN
# Email (Gmail default)
EMAIL_SMTP_SERVER=smtp.gmail.com
EMAIL_SMTP_PORT=587
EMAIL_USER=email@gmail.com
EMAIL_PASSWORD=YOUR EMAIL PASSWORD
VACATION_RECIPIENT_EMAIL=EMAIL FOR VACATION REQUEST
```
- **Ngrok Token** you must create a Ngrok account so you can have a private url and add it to Slack "Event Subscriptions" request URL. \
```bash
ex: "https://NGROK_PUBLIC_URL_HERE/events-endpoint" (check Ngrok section below)
```
- **Bot User OAuth Token** can be found after you create an app on Slack workspace
- **Verification Token** can be found on "Basic Information" -> "App Credentials" of your Slack App
**Note:** \
The email configuration was intended to be used as a vacation request process. Change it to suit your needs.
## Docker
**Docker build and run**
```bash
docker-compose up
```
## Ngrok
Get the Ngrok public URL using the following URL
```bash
http://localhost:4040/api/tunnels
```
## Useful documentation
- [dep](https://github.com/golang/dep) (dependency manager)
- [Slack API in Go](https://github.com/slack-go/slack)
## ❗ Code of Conduct
We expect everyone to abide by our [**Code of Conduct**](./CODE_OF_CONDUCT.md). Please read it. 🤝
## 🙌🏻 How to Contribute
Check out our [**Contributing Guide**](./CONTRIBUTING.md) for information on contributing.
## License
slack-bot-server is licensed by an MIT license as can be found in the [LICENSE](./LICENSE) file.
## 💜 Thanks
Thanks to everyone contributing in any manner for this repo and we extend this thanks to everyone working on Open Source.
**Sharing is Caring**
## Contributors ✨