Formu-bot
Discord bot that does a lot of weird/interesting math
Adding a module
- In
commands.js
go toconst reqFiles
and add the name of the new module as akey: value
pair into the Object wherekey
is the global variable you want to use andvalue
is the file name for the new module. For examplenpc: "npc.js"
- In your new module, the first line should be
var bot = process.DiscordBot;
. - If there are subcommands associated with this module:
- Create a function and name it
<global variable of module>Check(){}
- For example, my
admin.js
file hasadminCheck()
. - Make sure to put in any parameters needed, usually msg and the object
message
.
- For example, my
- Use a
switch case
block in the newly created check function to test for subcommands
- Create a function and name it
- At the bottom of the file insert this:
var <var> = {
<check function name>: <check function name>
[, <any other functions to export>: <any other functions to export>]
}
module.exports = <var>;