Documentation ¶
Overview ¶
Package coffeebeanbot is a coffee bean inspired bot created to help me through my day. Its current focus is to handle "Pomodoro Technique"-style timeboxing notification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadDiscordAudio ¶
LoadDiscordAudio will load a DCA file, returning the data and/or any error that occurred.
Types ¶
type Bot ¶
type Bot struct { Config Config // contains filtered or unexported fields }
Bot contains the information needed to run the Discord bot
type Config ¶
type Config struct { CmdPrefix string `toml:"cmdPrefix"` // The prefix the bot will look for in chat before all known commands WorkEndAudio string `toml:"workEndAudio"` // The DCA audio file that will be played when a Pomodoro ends. This is only played if the user is in voice chat in the Discord Server (Guild). }
Config is the Bot's configuration data
func LoadConfigFile ¶
LoadConfigFile loads the config from the given path, returning the config or an error if one occurred. I generally prefer config files over environment variables, due to the ease of setting them up as secrets in Kubernetes.
type Logger ¶
type Logger interface { // Info logs a message with some additional context as key-value pairs Info(msg string, kvPairs ...interface{}) // Error logs a message with some additional context as key-value pairs Error(msg string, kvPairs ...interface{}) // Named adds a sub-scope to the logger's name Named(name string) Logger }
Logger is the interface that all logs are expected to use with this package.
type Secrets ¶
type Secrets struct { AuthToken string `toml:"authToken"` // AuthToken is all that we need to authenticate with Discord as the bot's user ClientID string `toml:"clientID"` // Used to create the invite link for the bot - this isn't necessary for Discord login, nor does it need to be "secret" }
Secrets is the Bot's per-user data, some of which is secret
func LoadSecretsFile ¶
LoadSecretsFile loads the Discord secrets from the given path, returning the Secrets or an error if one occurred.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package metrics handles the aggregated stats that can be reported to a metrics exporter for bot monitoring.
|
Package metrics handles the aggregated stats that can be reported to a metrics exporter for bot monitoring. |
Package pomodoro contains functionality for timing work tasks and calling a user-supplied callback on end or cancel.
|
Package pomodoro contains functionality for timing work tasks and calling a user-supplied callback on end or cancel. |