- Node 12 or newer (LTS recommended)
- VS Code (or similar)
- Discord Server
Go to Discord Apps Dashboard to create your new application or bot: https://discord.com/developers/applications/
- Create a
New Application
- Setup an app name and click on
Create
- Go to
Bot
settings and add a new one (here you can find thebot token
) - Go to
OAuth2
set the stope tobot
- Set the bot permissions to
Administrator
- Copy the scope invitation link and paste on a new tab. Then invite the bot to your server
Run the following command:
npm init # to setup your package
npm i discord.js # to install a Discord package and interact with their API
cp config.mock.json config.json # to setup the your private bot token
Then update the BOT_TOKEN
with your real one in the config.js
file.
{
"BOT_TOKEN": "YOUR_BOT_TOKEN_HERE"
}
You can reveal your private bot token in the
Bot
dashboard settings
node index.js
Now you can see your bot online on your Discord server