Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Development Environment Setup

Mitch Talmadge edited this page Jun 5, 2020 · 2 revisions

To begin developing this bot, you will need to follow these steps:

  1. Create an application on Discord.
  2. Create a development guild.
  3. Set up your config.json file.
  4. Install dependencies.
  5. Start the bot.

Creating an Application

To create your StudyBot application, visit https://discord.com/developers/applications and click "New Application." Give it any name.

Next, access the "Bot" tab and copy the bot's Token. Save this for later.

That's it for now!

Creating a Dev Guild

This bot is easiest to develop when you dedicate a private guild to it.

In Discord, create a new guild, and give it any name.

You will need to obtain the guild's ID, so to do this, please follow these steps to enable developer mode:

  1. Open your User Settings in Discord
  2. Go to Appearance
  3. Scroll to the bottom and enable Developer Mode.

Once developer mode is enabled, you can right click on the guild icon in Discord and click "Copy ID". Save this ID for later.

Set up config.json

WIP

Install Dependencies

To install the dependencies for this bot, just run npm install at the root of your cloned repository.

Start the Bot

Now you can start the bot! There are two ways to do this:

  • npm run debug: This will start the bot and connect to the MongoDB server specified in your config.json. You will need to install and run your own MongoDB server for this option.
  • npm run debug:mongo: This will start the bot with an in-memory MongoDB server which will automatically load its configuration into the bot so that you do not need to include it in your config.json.

For most people the debug:mongo option is best.

Once the bot is started, you will notice that it is using something called nodemon. This will automatically restart the bot every time you edit and save a file in the source code of this bot.

The last thing to do is make sure the bot has no errors, the logs look good, and the bot comes online in your Discord guild. Then, test it out and try joining a course or two.