discord bot for mnt amigos
Send a yes/no question to @everyone with prepopulated ๐ ๐ reactions
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)
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 whomever is specified. This command is mostly for example purposes for adding commands to amigo-bot rather than providing any real utility
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 between the given options, delimited by " or "
Lists the usage of each command
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.
This project uses counterfeiter to generate mocks for testing. The only one you'll probably be concerned with is fake_session.go. If you find that you need to add more methods from discordgo.Session
to amigobot.Session
, just make sure you have counterfeiter
installed (go get -u github.com/maxbrunsfeld/counterfeiter
), and run go generate ./...
from the project root to add the new methods to the mock.
There is a code generation tool for new handlers that you may find convenient. Do go install ./...
from the root directory to be able to use it.
- Create your new
Handler
withamigogen [name]
- Fill in method stubs
- Make sure you update the companion test for your implementation details
- Add an instance of your
Handler
implementation to theHandlers
array in handlers.go
See greet.go as a very simple example.
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.
After running go install ./...
in the root directory, you should be able to run the app with amigobot -t [your-bot-token]