# README
amigobot
discord bot for mnt amigos
Commands
?yn [prompt]
Send a yes/no question to @everyone with prepopulated 👍 👎 reactions
?cals [username]
Display a table of the current day's foods and calories from the MyFitnessPal account for the given username (your account must be public for this to work)
?macros [username]
Display a table of the current day's macros from the MyFitnessPal account for the given username (your account must be public for this to work)
?greet [someone]
Greet whomever is specified. This command is mostly for example purposes for adding commands to amigo-bot rather than providing any real utility
?remindme duration [subject]
Remind the user after a specified time delay. The time should be given in the format specified here, e.g. 10h35m21s. The bot will acknowledge the request with the specified time.
If no message is supplied, the invoking message will be pinned after the time has elapsed.
If a message is supplied,a message will be sent with the included reminder.
?decide option [ or option...]
Decide between the given options, delimited by " or "
Contributing
Getting Started
This project requires Go 1.11+ modules for dependency management. Here are docs for modules, including usage, adding, and upgrading modules. Simply git clone
the project outside of your $GOPATH, and run go build ./...
in the root of the project to download all necessary modules. Run go test ./...
to verify everything is working properly.
To Add A New Command...
- Create a new package
- Implement the
Handler
interface found here. - Write a companion test for your new
Handler
- Add an instance of your
Handler
implementation to thehandlers
array in main.go
See greet.go as a very simple example.
Tests
run all tests with go test ./...
to verify you haven't broken any command. Again follow the greet example to see how to mock the use of a real discord session.
Running Locally
In the .../amigobot/cmd/amigobot
directory, run go install
Now you should be able to run the app with amigobot -t [your-bot-token]