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!
Section titled WindowsWindows
- Download from the Node.js website.
- Use fnm.
- Use Volta.
Section titled macOSmacOS
- Download from the Node.js website.
- Use fnm.
- Use Homebrew.
- Use nvm.
- Use Volta.
Section titled LinuxLinux
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.
You'll be asked the directory to create the application in, as well as whether TypeScript should be used. Dependencies will automatically be installed for you. After this, you've just got your startup Discord bot template nearly ready!
In the next section, we will explain how to create an application to interact with Discord's API.