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 aCommandobject, 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 thedistfolder.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 thedistdirectory and recompiles the discord bot.compile:tools- Cleans thedistdirectory and recompile the discord bot in tool mode, which basically includes thesrc/_toolsfolder in the final build.clean- Deletes thedistdirectory.deploy-commands:production- Deploys the slash commands to the server specified by theauth.config.jsonfile. See the Auth Config section for more information.deploy-commands:development- Deploys the slash commands to the server specified by theauth.debug.config.jsonfile. See the Auth Config section for more information.build- Cleans thedistdirectory, regenerates the autogenerated code, and then recompiles the discord bot.generate- Assuming you are developing under therucogs-infrastructuremono-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