A bot for the Marin Makers' Discord Server written with discord.js.
To deploy the bot, clone this repo, navigate to it, run npm install
to install all dependencies, and run node bot.js
.
- Dice Rolling
- Twitter posting, searching, viewing trends
- Help and Rules
- To-Do List/Tracking
- Last Seen
- Banana eating, lenny, and coding advice
- Polls/Voting
- News Summary
- Query search engines
- Marin Makers Website
To add commands to the bot:
- Create your command in a .js file in the directory
/nifty
as a module. - In bot.js, require the .js file with an appropriate variable name.
- Add to the
commands
object as shown in the example object.
Each Command will have 3 properties: process
, usage
and description
.
Each command includes a process
property, which contains the function executed by the command. This should take two parameters - the message
object, and argument
, which is any text trailing the command.
For commands, it can be useful to have multiple functions in your module stored under the same process
(such as how !twitter tweet
, !twitter search
, and !twitter trending
are all handled by one command object).
In general, commands can be designed like this:!command method parameters
Methods are the sub-commands that call different functions in your module, and should be one word long. They can be pulled from the argument parameter fed to the process
property with getMethod(argument)
.
Parameters are any additional text that you want to feed to your methods. They can be of any length, and can be pulled from the argument parameter fed to the process
property with getParameter(argument)
.
Next is the usage
property. This should be a string listing all possible arguments in your command.
If your command does not require any additional arguments, do not create a usage property.
And finally, a description
property which is just a plaintext explaination of what the command does.
Be sure to describe what every possible instance of usage
does in order of appearance, and keep it brief.