← Back to lessons

Lesson 1 — Run the Bot

Goal: Get the handler online without changing any framework code.

Video

Step-by-step

Step 1 — Install Node.js (if needed)

Download Node.js LTS. Then restart VS Code after installing.

Step 2 — Open the handler folder in VS Code

You should see: index.js, app.js, config.json.

Step 3 — Install dependencies
npm install
Step 4 — Create a bot in Discord Developer Portal

Copy your bot token + application (client) ID.

Step 5 — Fill out config.json

Open config.json and set:

{
  "TOKEN": "PASTE_TOKEN_HERE",
  "PREFIX": "!",
  "APP_ID": "PASTE_CLIENT_ID_HERE",
  "DEV_GUILD_ID": "PASTE_TEST_SERVER_ID"
}

Tip: DEV_GUILD_ID is the server you test commands in.

Step 6 — Start the bot the correct way
node index.js

Important: In this handler, index.js is the correct start point.

Step 7 — Invite the bot to your server

Use OAuth2 URL Generator → bot + applications.commands → give permissions → invite.

Common mistakes

Completion checklist

Next → Lesson 2