Skip to content

Installation

To create a bot application, refer to this Discord.py guide. Once your application is set up, return here to continue.

The config.json file contains all global configuration options for your bot. Below is a sample default configuration:

config.json
{
"token": "",
"clientId": "",
"guildId": "",
"logger": {
"enable_debug": false
},
"storage": {
"enabled": false,
"mongodb": "mongodb://localhost/database"
}
}

Fill in each value for the bot to function correctly.

Your bot’s token is required to connect to the Discord API and appear online. Obtain your token from the Discord developer portal and enter it here. For details, see step 7 in the Discord.py guide.

This is your bot’s application ID. Find it in Discord Developer Portal > [Your Application] > General Information > APPLICATION ID.

Bot Application ID

This is the Server ID where your bot will operate. To get it, enable Developer Mode in Discord, then right-click your server icon and select Copy Server ID. Learn how to enable Developer Mode in this guide.

Copy Server ID

After configuring your bot, ensure you have the following requirements:

  • Node.js
  • NPM
  • A server (Linux, macOS, or Windows)

Node.js runs your bot, and NPM manages dependencies. If not installed, follow this guide.

Open a terminal in your bot’s root folder and run:

Terminal window
npm install

This command installs all required dependencies.

Start your Discord bot with:

Terminal window
node index.js

After a few seconds, your bot should appear online in your Discord server.