Page 2: Setup Dev Env & Install Library

2. Development Environment Setup and Library Preparation

We will develop the Discord bot using Node.js, which can be downloaded from its official website.

2.1. Project Folder Creation and Initialization

Open your Terminal or Command Prompt, create a folder to store your bot files, and initialize it.

mkdir discord-bot-project
cd discord-bot-project
npm init -y

2.2. Installing discord.js

Install discord.js, the most widely used Discord library for Node.js.

# Install the stable, current version
npm install discord.js

You are now ready to create the index.js file to write the core logic of your bot.