https://github.com/seanpfeifer/coffeebeanbot
A Discord bot created to help me through my day. Its current focus is to handle "Pomodoro Technique"-style timeboxing notification.
https://github.com/seanpfeifer/coffeebeanbot
bot discord discord-bot discordapp go golang pomodoro pomodoro-technique
Last synced: 9 months ago
JSON representation
A Discord bot created to help me through my day. Its current focus is to handle "Pomodoro Technique"-style timeboxing notification.
- Host: GitHub
- URL: https://github.com/seanpfeifer/coffeebeanbot
- Owner: seanpfeifer
- License: mit
- Created: 2017-08-21T17:15:54.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T00:15:45.000Z (about 1 year ago)
- Last Synced: 2025-04-17T13:16:02.839Z (about 1 year ago)
- Topics: bot, discord, discord-bot, discordapp, go, golang, pomodoro, pomodoro-technique
- Language: Go
- Homepage:
- Size: 240 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CoffeeBeanBot
[](https://discord.com/api/oauth2/authorize?client_id=347286461252370432&scope=bot%20applications.commands) [](https://godoc.org/github.com/seanpfeifer/coffeebeanbot) [](https://goreportcard.com/report/github.com/seanpfeifer/coffeebeanbot) 
`coffeebeanbot` is a coffee bean inspired Discord bot created to help me through my day. Its current focus is to handle "Pomodoro Technique"-style timeboxing notification.
If you simply want to use the bot, and not run your own or customize it, you can [invite it to your Discord server using this link](https://discord.com/api/oauth2/authorize?client_id=347286461252370432&scope=bot%20applications.commands).
* `/pomstart`: Starts a pomodoro
* `/pomcancel`: Cancels the pomodoro
## Getting Started
### Running using Docker
For Linux, assuming your `discord.toml` lives at `./secrets`:
```sh
docker run -v $(pwd)/secrets:/secrets docker.pkg.github.com/seanpfeifer/coffeebeanbot/cbb:2.1.0
```
For Windows PowerShell, assuming your `discord.toml` lives at `./secrets`:
```powershell
docker run -v ${PWD}\secrets:/secrets docker.pkg.github.com/seanpfeifer/coffeebeanbot/cbb:2.1.0
```
Metrics are disabled by default (see `Metrics` below). If you want your container to report to Stackdriver, you need to override the Docker container's parameters to add `-stackdriver`:
```sh
docker run -v $(pwd)/secrets:/secrets docker.pkg.github.com/seanpfeifer/coffeebeanbot/cbb:2.1.0 -cfg /bot/cfg.toml -secrets /secrets/discord.toml -stackdriver
```
### Installation
If you simply want to build + install the `cbb` binary on your own, run the following:
```sh
go get github.com/seanpfeifer/coffeebeanbot/cmd/cbb
```
Retrieve the package using:
```sh
go get github.com/seanpfeifer/coffeebeanbot
```
Build and install the `cbb` bot binary using:
```sh
go install github.com/seanpfeifer/coffeebeanbot/cmd/cbb
```
### Configuration
Two files are used for configuration:
* `cfg.toml` - general bot config
* `discord.toml` - bot secrets that shouldn't be shared with others
Create a `cfg.toml` file that exists wherever you want to run the bot from.
Sample `cfg.toml`:
```toml
workEndAudio = "audio/airhorn.dca"
```
Sample `discord.toml`:
```toml
authToken = "PASTE_AUTH_TOKEN_HERE"
appID = "PASTE_APPLICATION_ID_HERE"
```
The `authToken` and `appID` values can be found at https://discordapp.com/developers/applications/me
* Create your App and copy the `Application ID` into your `discord.toml`.
* Click `Create a Bot User`.
* Under "App Bot User" click "click to reveal" on `Token` and copy the value into your `discord.toml`.
* Save Changes.
* Ensure your bot's `Public Bot` setting is what you want it to be.
### Usage
Run the bot's `cbb` executable from the directory containing your `cfg.toml` and `./secrets/discord.toml`. See the output of `cbb -h` for details.
Invite the bot to one of your servers via the URL `https://discordapp.com/api/oauth2/authorize?client_id=CLIENT_ID_HERE&scope=bot%20applications.commands`, replacing `CLIENT_ID_HERE` with your client ID shown in your config.
To show the current list of commands (and your bot's invite button), use the bot's profile in Discord.
### Metrics
The following aggregated metrics can be recorded so you can tell how your service is performing:
* `connected_servers` - the current number of connected servers (Discord Guilds)
* `pomodoros_running` - the current number of Pomodoros actively running
* `pomodoros_started` - the count of Pomodoros started
Aggregated metrics for your running servers are only ever sent to either standard output, or to your Stackdriver if you have it configured. No personal information is ever sent from this service.
To enable sending metrics to stdout, use the command-line parameter `-stdoutMetrics`
To enable sending metrics to your configured Stackdriver, use the command-line parameter `-stackdriver`