GithubHelp home page GithubHelp logo

amigobot's Introduction

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]

amigobot's People

Contributors

ryanmiville avatar davezabriskie avatar jangsi avatar azure-pipelines[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.