https://github.com/cephalization/chihuahua-bot
Slack bot
https://github.com/cephalization/chihuahua-bot
Last synced: 10 months ago
JSON representation
Slack bot
- Host: GitHub
- URL: https://github.com/cephalization/chihuahua-bot
- Owner: cephalization
- License: mit
- Created: 2020-02-04T01:19:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-14T22:47:27.000Z (about 6 years ago)
- Last Synced: 2025-05-01T14:47:24.717Z (about 1 year ago)
- Language: Go
- Size: 91.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chihuahua-bot
Slack bot
## Libraries
---
[Slack](https://github.com/nlopes/slack) - Slack Bot API client
[ansi](https://github.com/mgutz/ansi) - Pretty terminal colors
## Development
---
- install `go 1.13`
- install `docker`
- If using windows 10 home, install [docker-toolbox](https://docs.docker.com/toolbox/toolbox_install_windows/) instead
- If you use toolbox you'll have to use their "quickstart-terminal" unfortunately
- Should probably just do all of this in windows subsystem for linux (wsl)
- clone this repo
- create `.env` file using `.env.sample` (in the repo) as reference
- token obtained from https://api.slack.com/legacy/custom-integrations/legacy-tokens once you have permissions to develop on the bot
```
token=slackbot_api_token
```
- in the repo, run `docker-compose up -d`
- if you leave out the `-d` you can see all of the logging and messages
- `ctrl-c` will kill the bot like this
- to shut down bot, run `docker-compose down`
If docker isn't working or you don't want to use docker you will have to load the environment variables some other way
`token=slackbot_api_token ./chihuahua-bot`
### Useful development commands
This section is mostly dedicated to docker since it makes development so much easier.
- `docker-compose up` will run the last built version of the bot and print output of all containers
- `docker-compose up --build` will rebuild all the containers, useful when files change
- `docker-compose up -d` will run the containers in the background
- I usually run `docker-compose up --build -d`
- `docker-compose down` will tear down all containers
- `docker image prune` will delete stopped containers to get some disk space back
- `docker logs ` will show you the output of a container running in the background
- `docker logs chibot` will show you the bot's output
- `docker logs mongodb` will show you the db output
- `docker exec -it /bin/bash` will put you in a terminal inside a container
- `docker exec -it mongodb /bin/bash` will be useful to query the mongodb manually.
- You could also download a mongo gui (mongodb compass) and point it to the default mongo ports it provides while the container is running.