Gamgee
"There's some good in this world, Mr. Frodo, and it's worth fighting for."
A Discord bot to play around with APIs and things
Prerequisites
This project requires NodeJS (version 12 or later), NPM, and a Discord bot account token. To make sure you have them available on your machine, try running the following command:
$ npm -v && node -v
6.14.11
v14.6.0
Clone the Repo
$ cd path/to/parent
$ git clone https://github.com/AverageHelper/Gamgee.git
$ cd Gamgee
Table of contents
Usage
Running the bot
You'll need a Discord bot account's token. See this awesome tutorial on how to get one.
With token in hand, create a file called .env
in the root of your project folder. Save your token in that file, like so:
# .env
DISCORD_TOKEN=YOUR_TOKEN_HERE
Do not commit this file to git or your bot will get hacked.
Install the necessary dependencies:
$ npm install
And start the bot:
$ npm start
Running the tests
To run all tests with code coverage, run:
$ npm test
To run tests on files you've changed and automatically rerun tests as changes occur, run:
$ npm run test:watch
To run the style linter, run:
$ npm run lint
Commands
All commands must begin with the configured prefix (!
by default).
ping
Gamgee responds with "Pong!"
yt
Given a YouTube video URL or video ID, Gamgee responds with that video's title and duration in minutes.
config
Access the persistent config.
config get <key>
Gamgee responds with the current configuration value for the provided key.
config set <key> <value>
Sets a new value for the provided key. Gamgee responds with a confirmation of the new key and value, with an option to undo.
Options
The following options are valid config key
s:
command_prefix
Contributing
Please read CONTRIBUTING.md (soon) for details on our code of conduct and the process for submitting pull requests to us.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Add your changes:
git add .
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request 😎
Built With
Authors
- James Robinson - Initial work - AverageHelper