Learn how to code a Discord bot using JavaScript / Node.js and host it for free in the cloud using Repl.it. You will also learn to use Repl.it's built-in database.
🚨 At 13:44, Replit now has a new method for environment variables. Read what to do here:
🔗 Get 3 months FREE of the Hacker Plan on Repl.it (first 1000 people):
This course was developed by Beau Carnes.
🎥 Code a Discord Bot with Python Video:
💻 Full code on repl.it:
🔗 Online code editor:
🔗 Discord Home Page:
🔗 Discord Developer Portal:
🔗 Discord.js library:
Need help with this tutorial? You can ask questions here:
⭐️ Course Contents ⭐️
⌨️ (00:00) Introduction
⌨️ (01:38) Creating a Discord Server
⌨️ (02:27) Creating a Bot User
⌨️ (06:23) Starting a Project in Repl.it
⌨️ (08:37) Coding a Basic Discord Bot
⌨️ (15:44) Improving the Bot
⌨️ (26:35) Using the Repl.it Database to Store Bot Settings
⌨️ (46:08) Testing the Bot
⌨️ (50:22) Creating a Web Server for the Bot
⌨️ (55:06) Connecting Uptime Robot So Bot Runs Continuously
Special thanks to Repl.it for providing a grant that made this course possible.
—
Learn to code for free and get a developer job:
Read hundreds of articles on programming:
And subscribe for new videos on technology every day:
We want more beau stuff, he is an awesome teacher!
yea he is
@PEPPArody can you tell me how to make .env file now?
yea your right he is a awesome teacher
@PEPPArody Nah, hes freecodecamp’s youtube manager
@Freshman_Bill BBC i
I think that teaching programming with Discord and any type of software used in our free time with friends on the internet is the best way to start and understand what we are able to do with coding, great video and great channel, learned alot with y’all
I’ve been looking for that yesterday and boom! My favourite code learning channel delivers.
You guys are amazing!
Great tutorial sir… very helpful…
I love when you make Discord Bots. I am a big fan of Discord and I really as well love it when Beau Carnes is teaching since he is a sooooo good teacher when it comes to programming
Your misspellings and typos actually make the tutorial more understandable, thank you for the great content
Also your name reminds me of that nosleep series
I absolutely adore this channel, I learned more about coding languages and algebra/calc here than I have in my entire life in school! *It’s a blessing that it’s all free too!*
Thank you, Beau. This tutorial was really good and surprisingly simple and easy to follow! The way you explained the mess of arrays at 19:42 was easily understandable. Hats off to you
What a high level of energy he has so much needed in this type of enthusiasm in our professors.
I have no idea how to thank Beau! I’ve been looking around YouTube for a long time on how to host the bot for free! Honestly, thanks Beau!
can anyone help me
replit doesn’t allow to create .env files anymore …what to do
@RomanDler I can help. Replit updated their system and now, in the left side panel, it has a lock. click on that and type in token, but the token in the value, and press add new secret.
@Montage Clipzxs thank you so much you dont understand how much you helped!
@RomanDler No problem
@Montage Clipzxs How do u do the .env thing?
I recommend you guys to use a command handler as its much easier to sort out commands
At 13:44, Replit has a new method for .env. Read what to do here: https://docs.replit.com/programming-ide/storing-sensitive-information-environment-variables
Also, with Discord.js v13 there is more setup required. This quick video shows the new method: https://youtu.be/zGy2muWlE5A
This video is SO outdated look for something else guys
@Yuki YGO tried this but kept getting TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client
@Yuki YGO it still dosent work…. is says {client missing intents} from where should i get intents???
Hey guys – https://discordjs.guide/creating-your-bot/#creating-the-main-file. If anyone of you has discord maybe we can brainstorm together. I am huffing it on my own in vscode not repleit.
THANK YOU SO VERY MUCH BRO THIS IS THE ACTUAL BEST
Most of these channels dont Include to put in Intents in the “const client = new discord.Client({ intents: [“GUILDS”, “GUILD_MESSAGES”] })”
If you don’t include these, it will not work and throw up an error
You’re a life saver- thank you
copied it from overstack flow? haha
@GULI _BUILD everyone does;)
@pyropro he teaches you to put it at the top of the code in the video right? there. I’ve just made a change to it.
this is really helpful
This was a great tutorial! Thank you so much!!
The style of explanation is incredible! Its like he speaks the Code… never seen this before. Everything makes sense perfectly. Thanks a lot
In your package.json, update
“dependencies”: {
“discord.js”: “^12.5.3”
}
and the tutorial will go smooth for you, without worrying about the updated versions of discord.
Such a perfect tutorial! i thought it was harder to create discord bots, but it’s so easy! Cannot wait to create my own ones.
if code don’t work, in shell do “npm install node-fetch@2.6.1” in shell and hit enter! then type “npm i discord.js@12.5.3” thats should make it work!
thank u soo much dude, this helped me from starting over the entire thing all over again
@Rahul V v12 sucks, just learn what ur code is doing and then fix it.
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client. (/home/runner/PessimisticMysteriousDatabases/index.js:2:16)
at Client._validateOptions (/home/runner/PessimisticMysteriousDatabases/node_modules/discord.js/src/client/Client.js:548:13)
at new Client (/home/runner/PessimisticMysteriousDatabases/node_modules/discord.js/src/client/Client.js:76:10)
at Object.
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Read ur error
Really awesome and straight to the point! Looking forward to learning more from you