Categorygithub.com/ryanmiville/amigobot
repositorypackage
1.2.0
Repository: https://github.com/ryanmiville/amigobot.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

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

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

  1. Create a new package
  2. Implement the Handler interface found here.
  3. Write a companion test for your new Handler
  4. Add an instance of your Handler implementation to the handlers 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]