Structure
Folder Structure
src
- Containsserver.ts
- The entry point of the discord bot. It reads the command line arguments or environment variables to start a server in development or production mode.config
- Stores config files that change how the discord bot runs. See the Config section for more informationcommands
- Contains code for slash commands. Each slash command is represented by a script that exports aCommand
object, which defines the command and the handlers for it. Note that sub commands are handled manually by each command script._tools
- Contains code used by Node.JS scripts defined in ourpackage.json
.generated
- Auto-generated code based on our GraphQL schemamisc
- Contains miscellaneous helper codeshared
- Code that's shared between the backend and frontends
dist
- Where the release version of the discord bot is stored once you build it.gulpfile.js
- Script that automates copying assets over when you build the discord bot.rucogs-discord.service
- Service file for hosting discord bot. See DevOps/Hosting for more information.tsconfig.json
- Configuration for TypeScript
NodeJS Scripts
start
- Runs the built discord bot from thedist
folder.start:recompile
- Compiles the discord bot and then runs it.start:rebuild
- Regenerates and recompiles the discord bot, and then runs it.compile:app
- Cleans thedist
directory and recompiles the discord bot.compile:tools
- Cleans thedist
directory and recompile the discord bot in tool mode, which basically includes thesrc/_tools
folder in the final build.clean
- Deletes thedist
directory.deploy-commands:production
- Deploys the slash commands to the server specified by theauth.config.json
file. See the Auth Config section for more information.deploy-commands:development
- Deploys the slash commands to the server specified by theauth.debug.config.json
file. See the Auth Config section for more information.build
- Cleans thedist
directory, regenerates the autogenerated code, and then recompiles the discord bot.generate
- Assuming you are developing under therucogs-infrastructure
mono-repo, this copies the generated code from the backend submodule's folder.
Note
To run a NodeJS script you have to run the follow code inside the repository's directory.
> npm run script_name