Learn to code a Discord bot with JavaScript using Node.js.
🔗 Written Tutorial – https://www.devdungeon.com/content/javascript-discord-bot-tutorial
🔗 Unicode Emojis – https://unicode.org/emoji/charts/full-emoji-list.html
🔗 Official Documentation – https://discord.js.org
Tutorial by Dev Dungeon. Check out their YouTube channel: https://www.youtube.com/channel/UCgkG68BiCngkoV7I2BLtAVg
—
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://medium.freecodecamp.org
And subscribe for new videos on technology every day: https://youtube.com/subscription_center?add_user=freecodecamp
Original source
47 responses to “How to Build a Discord Bot – Full JavaScript Chatbot Tutorial”
Thanks, freeCodeCamp.org, for sharing this with your audience! I hope it is fun and interesting for everyone. Check out https://www.devdungeon.com for more tutorials.
And how do i turn that god damned thing off?
I can't see 1:cmd in the Terminal, I see only 1: powershell it is problem?
Those who did the "npm install discord.js" command and encountered an error, try opening cmd and type in "npm init -y" and then restart visual studio code and "npm install discord.js" should work
When I did, "npm install discord.js" is came back with
"Invalid version: "npm install discord.js"
NO WAYS IT ACTUALLY WORKED
Can someone tell me what the best programming language is for making discord bots? I cant find any info on it :/
how to get a devloper code
I entered "node my_bot.js" it replied "node is not recognized as an interval or external command, operable program or batch file." How do I fix this issue?
love it it works!
When ever I try to add the bot to my server it just says "Bot requires code Grant" And I don't understand what it means.
" 'npm' is not recognized as an internal or external command,
operable program or batch file."
When u run node my_bot.js and doesnt work, save the file. I think some people have autosave on
What is a discord bot?
When I do node my_bot.js my nose is yellow
word for word i have and dont work
node my_bot.js not working, my bot in not going online.
Thank's, very useful tutorial 🙂
Hi, after i attempt to connect to the bot nothing happens. I don't get any errors, it just doesn't print anything, and the bot is still offline. I've made sure i've copied your code exactly.
'npm' is not recognized as an internal or external command,
operable program or batch file.
its telling me split isnt a command here is my code: let commandSplit = fullCommand.split("")
Well when I used node (my bot) it didnt mention that it connected nor went online in my server
Finally it's explained how to make a discord bot. Thank you
The screen cannot be set to the number of lines and columns specified.
after type npm install discord.js
can somebody help me pls?
(function (exports, require, module, __filename, __dirname) { const Discord = require(discord.js)
^
ReferenceError: discord is not defined
at Object.<anonymous> (/home/cedrichoelper/Schreibtisch/Chatbot/chat.js:1:87)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
so easy with 2 monitors watching the video on one and code on the other
I DONT UNDERSTAND ANYTHING
4:10 WHAT DO YOU MEAN? D;
I don't quite understand making commands. I'm trying to make an "!add" command, using nearly the exact same coding as the multiply command, but it keeps telling me addCommand is not defined
When I try to do npm install discord.js. It won't let me.
I did everything right but node my_bot.js is not working for me. I even tried making sure to capitalize it (my file is capitalized). Can you help me?
'"node"' is not recognized as an internal or external command,
operable program or batch file.
'"node"' is not recognized as an internal or external command,
operable program or batch file.
when i type:
node xxxx.js
to the terminal it says:
Error: cannot find model user/xxx/(the place that i placed the archive)
What happened? it worked out before but not now, i throught it was npm reader problem so i reinstalled discord.js
Didn't work so i reinstalled node , but also didn't work i installed
npm @types/node but also didn't work i am totally loose now
I want to create a discord bot that sends people alts. So you do !alt and get an alt. Can you possibly help me? My Discord name is Wulfix # 6381
the "npm install discord.js" commands judt comes up with a bunch of errors
Finally someone made this! Discord's tutorial they had on their site, was confusing!
Neato burrito
I wrote a bot in python and it has some functinos. But now I wonder how I can run a loop that checks every 10 seconds for smt, while keeping all the other features available.
Did anyone figure out how to display the current Bitcoin Chart?
Welp, after following your intructions to a tee, I am unable to get the bot online and get the message at 7:58
Could I make a actual chatbot… where you talk to it.. & it says things back? I have the code that I want to use… but I am wondering if it will work or not. & I need help making it happen. It deals with import js, import js field, & ect… I like the code. I just wish if it will work on discord
Hey can anyone help me please.
I want to become a web developer. There are a lot a resources and tutorials to learn the stuff but I don't know where to start. Can you please tell me what path should I follow as in what all should I learn to become a web developer? Like I know we have to learn Html, CSS and Javascript. After that what all must be learnt?
Your channel is fucking amazing!
Nice tutorial, good job.
I already started making a Discord bot with Python, but from I see and from I hear from others, the NodeJS version is easier for the development.
But I don't know which of the two is more efficient in terms of latency and resources consumption.
Amazing.
Discord a great platform for any gamer!
This channel is blessing for js devs.
That was awesome. Loved it. I had my very first bot ready. Playing with documentation now for further customization.