Getting Started

To get started using CDGen, all you need to do is load up your console and type cdgen. This will bring up a question like this:

Generating a new project

Once you have typed cdgen you'll want to select "Create". It will then ask you a few questions:

  1. What would you like to call your project? (E.g. discord-bot)

  2. What language do you use? (Select from either JavaScript or TypeScript)

  3. What package manager do you use? (Select from either NPM or Yarn)

  4. What command/event handler would you like to use? (Select from either CDCommands or CDHandler)

After answering these questions, it will install the required dependencies to start the project. You'll then need to answer a few more questions:

  1. What is your bot token? (You can get this from Discord Developer Portal)

  2. What is your mongoose uri? (You can get this from your MongoDB Page)

  3. What do you want your bots prefix to be? (E.g. ?)

  4. Where do you want your commands stored? (Default is "commands")

  5. Where do you want your events stored? (Default is "events")

  6. Where do you want your features stored? (Default is "features")

It's as easy as that, now you can cd into your project folder to get started making your bot! CDGen will put your Mongo URI and your Bot Token in a .env file, it will also create a file called CDConfig.json. Please do not edit the CDConfig.json file unless you know what you are doing, CDGen uses this to know where to make new files, what language and what handler.

Note:

It will not add all the options for creating the new instance of CDCommands or CDHandler, it is recommended that you still read through the handlers guide.

You will also need to go to the ./package.json file and change "main": "index.js", to "main": "src/index.js", If you use typescript it will need changing to "main": "src/index.ts",

What should your project look like now?

The images below will be for if you generated a new project using JavaScript and CDCommands.

In the example below the events folder will be called "events_folder" as I chose to use a custom events folder name rather than the default "events".