Section titled Starting outStarting out

Our create-discord-bot command-line interface sets up a basic Discord bot to help you get started on your journey.

Section titled Creating your botCreating your bot

To use discord.js, you'll need to install Node.js, Deno, or Bun. discord.js v14 requires Node.js v16.11.0 or higher, but the long-term support (LTS) version is always recommended. For the purposes of this guide, we will be using Node.js.

To check if you already have Node.js installed, run node --version in your terminal. If it outputs v16.11.0 or higher, then you're good to go!

Tip

Section titled WindowsWindows

Section titled macOSmacOS

Section titled LinuxLinux

  • Visit this page to determine how you should install Node.js.
  • Use nvm.

After installing Node.js, you'll be able to create a new application from your desired package manager. If you're starting out fresh, installing Node.js will also install npm, a package manager for Node.js.

npm
yarn
pnpm
bun

npm create discord-bot

You'll be asked the directory to create the application in, as well as whether TypeScript should be used. Dependencies will be automatically installed for you. After this, you've just got your startup Discord bot template nearly ready!

Next, we'll need to create an application so we are authenticated use Discord's API. This will be covered in the next section.