First thing you want to do is, go to https://discord.com/developers/applications
then, add an application.
Once your application is created, go to the bot tab on the right, and create a bot.
Go back to the main page of your application and copy the client id and put it in the link below where is says "INSERT_CLIENT_ID_HERE". https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=8
Once you have invited the bot to your server, go back to your bot's page, go to the bot tab and copy your token.
Coding your Discord Bot
Create a node.js repl.it page; once that is done, go to index.js, then copy this code below and paste it in index.js:
Installing Discord.js
Go to the shell next to your code and type npm i discord.js
once that is done, run your bot! when you type "ping" in Discord, the bot will respond with Pong!
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=16.6.0","npm":">=7.0.0"} (current: {"node":"12.22.4","npm":"6.14.14"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for
@discordjs/[email protected]: wanted: {"node":">=14.0.0"} (current: {"node":"12.22.4","npm":"6.14.14"})
npm WARN notsup Not compatible with your version of node/npm: @discordjs/[email protected]
npm WARN notsup Unsupported engine for @discordjs/[email protected]: wanted: {"node":">=14.0.0","npm":">=7.0.0"} (current: {"node":"12.22.4","npm":"6.14.14"})
npm WARN notsup Not compatible with your version of node/npm: @discordjs/[email protected]
npm WARN notsup Unsupported engine for @sapphire/[email protected]: wanted: {"node":">=14","npm":">=6"} (current: {"node":"12.22.4","npm":"6.14.14"})
npm WARN notsup Not compatible with your version of node/npm: @sapphire/[email protected]
How to set up a Discord Bot using node.js and repl.it
Creating your Discord Bot:
First thing you want to do is, go to
https://discord.com/developers/applications
then, add an application.
Once your application is created, go to the bot tab on the right, and create a bot.
Go back to the main page of your application and copy the client id and put it in the link below where is says "INSERT_CLIENT_ID_HERE".
https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=8
Once you have invited the bot to your server, go back to your bot's page, go to the bot tab and copy your token.
Coding your Discord Bot
Create a node.js repl.it page; once that is done, go to index.js, then copy this code below and paste it in index.js:
paste your token where is says "YOUR_TOKEN_HERE".
Installing Discord.js
Go to the shell next to your code and type
npm i discord.js
once that is done, run your bot! when you type "ping" in Discord, the bot will respond with Pong!
these errors appeared
how do i fix?
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=16.6.0","npm":">=7.0.0"} (current: {"node":"12.22.4","npm":"6.14.14"})
@discordjs/[email protected]: wanted: {"node":">=14.0.0"} (current: {"node":"12.22.4","npm":"6.14.14"})npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for
npm WARN notsup Not compatible with your version of node/npm: @discordjs/[email protected]
npm WARN notsup Unsupported engine for @discordjs/[email protected]: wanted: {"node":">=14.0.0","npm":">=7.0.0"} (current: {"node":"12.22.4","npm":"6.14.14"})
npm WARN notsup Not compatible with your version of node/npm: @discordjs/[email protected]
npm WARN notsup Unsupported engine for @sapphire/[email protected]: wanted: {"node":">=14","npm":">=6"} (current: {"node":"12.22.4","npm":"6.14.14"})
npm WARN notsup Not compatible with your version of node/npm: @sapphire/[email protected]