ryanmiville / amigobot

discord bot for mnt amigos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

amigobot

GoDoc Widget

discord bot for mnt amigos

Commands

?yn [prompt]

Send a yes/no question to @everyone with prepopulated 👍 👎 reactions

?yn screenshot

?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)

?cals screenshot

?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)

?macros screenshot

?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

?greet screenshot

?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.

?remindme acknowledgement

If no message is supplied, the invoking message will be pinned after the time has elapsed.

?remindme with no subject screenshot

If a message is supplied,a message will be sent with the included reminder.

?remindme with subject screenshot

?decide option [ or option...]

Decide between the given options, delimited by " or "

?decide screenshot

?help

Lists the usage of each command

?help screenshot

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.

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.

To Add A New Command...

  1. Create your new Handler with amigogen [name]
  2. Fill in method stubs
  3. Make sure you update the companion test for your implementation details
  4. Add an instance of your Handler implementation to the Handlers array in handlers.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

After running go install ./... in the root directory, you should be able to run the app with amigobot -t [your-bot-token]

About

discord bot for mnt amigos


Languages

Language:Go 100.0%