[NEW] How To Make A Discord Bot || Discord.JS v14

  Рет қаралды 172,894

Fusion Terror

Fusion Terror

2 жыл бұрын

To being our How To Make A Discord Bot series, this video I will be teaching you how to setup a Discord Bot using Discord.js v14. I'll be making handlers for events, commands and more with explanation so new Discord.js programmers are able to learn!
🔗 | Useful Links/Downloads:
📟 | Node.js: bit.ly/2IbYJG0
⌨️ | Visual Studio Code: bit.ly/2JIQfqC
🛸 | Discord Developer Portal: bit.ly/3lilrdW
📋 | Discord.js Docs: discord.js.org/#/docs/discord...
📋 | Discord.js Guide: discordjs.guide/additional-in...
📋 | Codecademy JavaScript: www.codecademy.com/learn/intr...
📋 | Codecademy Node.js: www.codecademy.com/learn/lear...
⚙️ | Visual Studio Code Extensions:
📂 | Theme - bit.ly/3OIZRh6
📦 | Icons - bit.ly/2YwSuQx
📝 | Formatter - bit.ly/3I7QYvL
Discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
By subscribing you are able to get post notifications for when I upload another Discord.js tutorial so you are then able to continue developing your bot! My Patreon also offers Discord.js files monthly for those who wish to support the community.
🔴 | Subscribe: bit.ly/38fncFj
🟠 | Patreon: / fusionterror
🟣 | Discord Server: / discord
🌌 Wanna get bigger on KZbin?
- I recommend TubeBuddy ✅, it's a free extension that allows you to advance your content creating skills with its many included tools. 🧰 Click the link below to install TubeBuddy to your browser!
📈TubeBuddy📈: www.tubebuddy.com/fusionterror

Пікірлер: 493
@FusionTerror
@FusionTerror 2 жыл бұрын
Check out the Discord Server if you have any Discord.js issues! 🔮- Fusion Empire Discord: discord.gg/QJyTkNxVrX 🟠- Patreon: www.patreon.com/fusionterror
@AydenC77
@AydenC77 2 жыл бұрын
Can I download your bot file
@rusanthruddy1925
@rusanthruddy1925 Жыл бұрын
when i run npn init -y it says The term 'npn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
@rusanthruddy1925
@rusanthruddy1925 Жыл бұрын
The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
@TailsDollOS
@TailsDollOS Жыл бұрын
> tails-doll-bot@1.0.0 test > node . node:fs:1450 handleErrorFromBinding(ctx); ^ Error: ENOENT: no such file or directory, scandir './src/commands.tools' at Object.readdirSync (node:fs:1450:3) at client.handleCommands (C:\Users\artco\OneDrive\Рабочий стол\Tails Doll Bot\src\functions\handlers\handleCommands.js:10:18) at Object. (C:\Users\artco\OneDrive\Рабочий стол\Tails Doll Bot\src\td.js:20:8) at Module._compile (node:internal/modules/cjs/loader:1120:14) at Module._extensions..js (node:internal/modules/cjs/loader:1174:10) at Module.load (node:internal/modules/cjs/loader:998:32) at Module._load (node:internal/modules/cjs/loader:839:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47 { errno: -4058, syscall: 'scandir', code: 'ENOENT', path: './src/commands.tools' } -------------------- any way to fix it?
@niezdefiniowanyM
@niezdefiniowanyM Жыл бұрын
@@rusanthruddy1925 you must use "npm" instead of "npn"
@supermanplayergd
@supermanplayergd Жыл бұрын
i can't say this is super good for beginners since it goes very very fast but for intermediate users of js it's really good! props to the tutorial i learnt a lot
@kjkeys6776
@kjkeys6776 Жыл бұрын
It's a good tutorial for how much information is crammed in. I think it would be helpful to explain in a little more detail while going through the tutorial instead of focusing on speed here. For example: "We require fs because it is the file system module which allows us to search through our file structure." Yes, it will take more time, however, it will make the tutorial a lot more clear and pass on greater understanding. Assume the audience has no knowledge of the topic even though you recommend the node and js tutorials at the start of the video.
@creative-Combat
@creative-Combat Жыл бұрын
and instead of just a tutorial your actually being taught coding
@antontarasov7921
@antontarasov7921 Жыл бұрын
He said this is for peeps who know JS and Node, innit?
@runnerR6
@runnerR6 Жыл бұрын
@@creative-Combat you are supposed to do that yourself haha, the turtorial does enough for that as anything you need to know about the topic can be found here or on google
@V9Void
@V9Void 10 ай бұрын
@@runnerR6 or just be a do it all person and copy down every letter lol. that is what I did and I became an expert lfmao
@Cookieukw
@Cookieukw 9 ай бұрын
I think it's unnecessary to explain obvious things if the focus of the video is precisely those who know about the subject and want to learn how to create bots. There's always a beginner complaining...
@BlytheChan
@BlytheChan Жыл бұрын
I've been going through your tutorials as a way to clean up my bot's current file system (it was a mess...) and set up so your speed and explanations were right up my alley (I already have a decent understanding of how it all works). Thank you!
@dollyp1ss299
@dollyp1ss299 Жыл бұрын
WOW, This is awesome Thank you so much for taking the time to show us how to code a bot!!! Just finished watching the video while creating my FIRST bot & its actually working! ❤
@omarshamsulhaque8093
@omarshamsulhaque8093 Жыл бұрын
watched 3 videos prior to this nothing works u helped me finally get my bot online tysm!
@MakerBlaker
@MakerBlaker 2 жыл бұрын
Wow! Fantastic content!
@willdeng7669
@willdeng7669 Жыл бұрын
It worked! It took me a whole day and in the end it worked somehow
@deizik89
@deizik89 Жыл бұрын
TypeError: Cannot read properties of undefined (reading 'push')
@michaelbleak3490
@michaelbleak3490 2 жыл бұрын
thank you so much for this, could you in the next few tutorials if you're continuing this show how to make the bot send messages and give responses plus how to get it to play music in voice channels as well?
@kolmioo
@kolmioo Жыл бұрын
message.channel.send("Hello World!")
@DapperNurd
@DapperNurd Жыл бұрын
Fix for anyone out there having the same issue as me... If you're getting an Invalid Body Form error on the rest.put(), check your commandArray. Mine was on line 16, it is probably around there, when you're pushing. Mine was: commandArray.push(command, command.data.toJSON()); when it needed to be: commandArray.push(command.data.toJSON()); Hope this helps.
@Sudomeapizza
@Sudomeapizza 8 ай бұрын
I noticed that aswell. I didn't notice that as he was talking, but saw the edit at the end when i noticed it looked different. Good catch!
@imagination0000
@imagination0000 Жыл бұрын
Great job, really helpful
@its_the_lagg
@its_the_lagg Жыл бұрын
hey I was following the video and I was trying to run the but then it said (Error: Cannot find module './functionshandlers/handleCommands.js') was wondering if anyone had a solution?
@caydin-mcst
@caydin-mcst 3 ай бұрын
HEY.. buddy I can't code anything it says something about the handlers not existing or something.. I'm not this advanced I followed one by one word and yet still crashing the code I have tried to figure it out but it just didn't work. PLEASE HELP ME!!!!#
@Fheara_Nyakki
@Fheara_Nyakki Жыл бұрын
As much is good tutorial is also a bit overwhelming for someone new in node js. Were hoping would have been easier to understand and beginner friendly with minimal stuff at the begin instead making 6932793 js files. But thank you anyway!
@PaperBagMan884
@PaperBagMan884 Жыл бұрын
"a bit overwhelming" Understatement of the century.
@miays7288
@miays7288 Жыл бұрын
same thought!!
@Senator_weeb
@Senator_weeb Жыл бұрын
Based comment detected
@TopGyearsago
@TopGyearsago Жыл бұрын
You can do all the stuff in one file so it doesn't matter and this is not a tutorial for javascript begginers anyways
@CapitanDirp
@CapitanDirp 2 жыл бұрын
Zoomed out. Also. For some of the files you aren't going to edit as much, mabey have a sorcebin link to that file so we have a higher chance of getting our bot online. But only the nessisarry files.
@amasinamr6046
@amasinamr6046 2 жыл бұрын
Useful tutorial thx u. Plz do you have any template suggestion for discord.js typescript
@bettyg7710
@bettyg7710 10 ай бұрын
I got to the part command handler. But the commandArray would not live outside the for loop. Inside the loop I can get data, outside the loop where you put it in the api statement no data. Can you help. If I do the console.log() it works.
@RocerEdits
@RocerEdits 9 ай бұрын
Bro can someone help me with this error: TypeError: Cannot read properties of undefined (reading 'name')
@gameknight_10
@gameknight_10 2 жыл бұрын
it says TypeError: Cannot read properties of undefined (reading 'push')
@cameronedens9391
@cameronedens9391 7 ай бұрын
I followed the video, and have gone over the code several times, and for some reason the code gets stuck after "Successfully reloaded application (/) commands." Does not do anything after this
@pharven
@pharven Жыл бұрын
Very nice tutorial!
@cosmicsaguaro
@cosmicsaguaro Жыл бұрын
You are a godsend. One tip though, don't stare at the camera without blinking.
@joqnix
@joqnix Жыл бұрын
hi, how did you get path autocomplete in vscode? the one on 15:47 for me it doesn't show a suggestive window like that~ for folders or files ~ i really need this to cuz i had alot of errors from mainly the paths~
@fyremusic6196
@fyremusic6196 Жыл бұрын
So on the main script: const functionFolders = fs.readdirSync(`./functions`); for (const folder of functionFolders) { const functionFiles = fs.readdirSync(`./functions/${folder}`).filter((file) => file.endsWith(".js")); for (const file of functionFiles) { require(`./functions/${folder}/${file}`)(client); } } Im getting an error at the require(...) on that last line since it is not a function. (You don't run into this issue on the handlers as that line uses a function before the require(...) which are then called later in the handler) Any fixes? This is the only error preventing me from running my code
@Chazebrimbor
@Chazebrimbor Жыл бұрын
Followed to a T - including case sensitivity and I've had nothing but error after error trying to run a test.
@rubbedman2775
@rubbedman2775 5 ай бұрын
is it 'node.js' is not recognized as an internal or external command, operable program or batch file.??
@BobbeDev
@BobbeDev 2 жыл бұрын
Does this have anything to do with all my bots breaking yesterday?
@p4cifier
@p4cifier 10 күн бұрын
23:12: at the end of the terminal it says "code: 'MODULE_NOT_FOUND'". Can someone explain me how to fix it or did I missed a step.
@stevenpereira1619
@stevenpereira1619 2 жыл бұрын
could you cover permissions for commands
@rizzeducation
@rizzeducation Жыл бұрын
This tutorial series is amazing! Please try and add more episodes! P.S = You just earned yourself another subscriber!
@RinatWOT
@RinatWOT Жыл бұрын
Why do you use require and module.exports and not import and export?
@kannaoki
@kannaoki Жыл бұрын
Why in me always TypeError: Cannot read properties of undefined (reading 'Guilds')
@chenhu2993
@chenhu2993 Жыл бұрын
node:internal/modules/cjs/loader:959 throw err; ^ Error: Cannot find module './funtions/handlers/handleCommands.js' Require stack: - C:\Users\saqq\Documents\Discord Bot\src\bot.js code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Users\\saqq\\Documents\\Discord Bot\\src\\bot.js' ]
@YukiGersaniba
@YukiGersaniba Жыл бұрын
"funtions"
@iplay6984
@iplay6984 4 ай бұрын
Whenever I run "npm run test" I get this > commands@1.0.0 test > node . But the bot never comes online can anyone help me?
@redpanther_tv
@redpanther_tv 2 ай бұрын
Hi Fusion i have watch your "How to make a Discord bot" I cant get my bot online if i type npm run test
@H4GRlD
@H4GRlD Жыл бұрын
Insanely helpful and good quality tutorial video, subscribed and gonna go on to the next episodes. :) I have a v12 bot myself what I've made for a gaming community, it's an ugly spaghetti code but with a lot of cool functionality, unfortunately bot died today, code is almost unmaintainable, maybe it's time to restart the project with fresh dependencies and mindset. Thanks for the help. :) Looking forward to a good approach for handling database interactions.
@YaItxSmoothy
@YaItxSmoothy 2 жыл бұрын
Help! Why does it say 'isChatInputCommand is not a function'? I did follow your steps correctly
@StrikesPerception
@StrikesPerception Жыл бұрын
THIS IS GREAT DUDE KEEP IT UP.
@FusionTerror
@FusionTerror Жыл бұрын
I’m glad you’re enjoying the series, thanks for your support!
@StrikesPerception
@StrikesPerception Жыл бұрын
Thank you so much man. It is absolutly helpful. I can't wait for more videos to come on this series. Keep up the good work 😎
@al8905
@al8905 9 ай бұрын
im getting "the application did not respond" checked for typos and other things and I found nothing
@RubenOchoaSanMartin
@RubenOchoaSanMartin Жыл бұрын
i need help with this error, i try to using /ping and the bot is crash TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function at Client. (C:\Users\TessioGG\Desktop\Discord GG's GTA & Shop\Bot\src\funciones\handlers\handleEvents.js:15:67)
@wackystufftho
@wackystufftho Жыл бұрын
I get "invalid form body" and i checked the code idk whats causing it
@niezdefiniowanyM
@niezdefiniowanyM Жыл бұрын
hey, i have a little problem my bot responding for command /ping once and then when i tried it second time i have error and my bot goes offline you know how to fix this?
@niezdefiniowanyM
@niezdefiniowanyM Жыл бұрын
oh nevermind, just started works
@Dswyy
@Dswyy Жыл бұрын
Getting error :/ TypeError: Cannot read properties of undefined (reading 'name') at client.handleCommands how to fix?
@deon_954
@deon_954 Жыл бұрын
im having the same error.
@owenr007
@owenr007 Ай бұрын
did you ever find a fix?
@user-os6oe6ww3e
@user-os6oe6ww3e 2 ай бұрын
thanks for your help.
@surfjoys
@surfjoys Жыл бұрын
thanks bro!
@ishaanjain3459
@ishaanjain3459 Жыл бұрын
im getting ENOENT: no such file or directory, scandir '/src/functions/handlers', there's not issue with the ' or ` but i cant figure it out
@treez3265
@treez3265 Жыл бұрын
yo i had near enough the exact same problem, you need to change "/src/functions/handlers" to "./src/functions/handlers"
@blackchaos7980
@blackchaos7980 Жыл бұрын
Something is wrong with the name function on line 15 in handlecommands.js and it keeps saying its undefined despite the fact that I did typed the code in perfectly.
@ForwardEn_
@ForwardEn_ Жыл бұрын
If You Use A Another Name Of The Folder, Please Change It
@dmitryulanov9395
@dmitryulanov9395 Жыл бұрын
nice content!
@w4ter437
@w4ter437 Жыл бұрын
what lane do you play??
@hiitstas
@hiitstas Жыл бұрын
met someone for the first time yesterday on discord, she asked me if I can make a bot for her server cuz I know how to code and I was like yeah why not, so here I'm btw thank u for this superb tutorial, can't wait to watch the rest of the series and make some cool bots
@petergg9096
@petergg9096 Жыл бұрын
simp
@hiitstas
@hiitstas Жыл бұрын
@@petergg9096 BRUHH I'm just nice 😭
@masasensei2916
@masasensei2916 Жыл бұрын
i have an error bro. Anyone can help me for fixed this error? echo "Error: no test specified" && exit 1
@refluent2
@refluent2 Жыл бұрын
You didn't follow the first part of the video. You need to change some of the code in the package.json. Try looking at 5:36.
@edgarbaylosis1523
@edgarbaylosis1523 Жыл бұрын
why i get the error when i run the code it said " error: ENOENT: no such file or directory, scandir './src/functions/${folder}'"
@neilbatten8453
@neilbatten8453 Жыл бұрын
so ive done and redone the project twice now and both times i get the error "Error: ENOENT: no such file or directory, scandir './src/functions/${folder}" i followed the tutorial exactly as was and the first call .src/functions goes through fine. anyone have an idea what i might be doing wrong?
@Jummmpy
@Jummmpy Жыл бұрын
make sure you use these quotes ` ` instead of these ' ' it makes a big difference
@theshark9001
@theshark9001 Жыл бұрын
i tried using this tutorial, right at the end it got all screwed up, i tried testing it, and it came back with TypeError: commands.set is not a function at client.commands (C:\Users\Shark\Downloads\Discord_Bot\src\functions\handlers\commands.js:15:26) at Object. (C:\Users\Shark\Downloads\Discord_Bot\src\bot.js:20:8) at Module._compile (node:internal/modules/cjs/loader:1205:14) at Module._extensions..js (node:internal/modules/cjs/loader:1259:10) at Module.load (node:internal/modules/cjs/loader:1068:32) at Module._load (node:internal/modules/cjs/loader:909:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12) at node:internal/main/run_main_module:23:47
@deon_954
@deon_954 Жыл бұрын
I finally got it online. Make sure you watch all his final js files around @22:05 he made some correction that he didn't show. make sure all you file path is correct according to the video before he turns the bot on.
@jeetrana3447
@jeetrana3447 Жыл бұрын
I watched the video but I still get error: Error: ENOTDIR: not a directory, scandir './src/events/ready.js' Help me fix it
@alainjohnferrer4944
@alainjohnferrer4944 Жыл бұрын
@@jeetrana3447 put the file ready.js inside client folder src/events/client/ready.js
@ashbassofficial1
@ashbassofficial1 Жыл бұрын
I am having the same error as Jeet, but with the ping.js file
@thariqthariq309
@thariqthariq309 15 күн бұрын
i had a error bro which says discord not defined what should i do
@Icasus
@Icasus Жыл бұрын
I love these, but sometimes you are changing code without actually showing it, giving quite a bit of headache to skip through the video and find fixes.
@TaylerPlays
@TaylerPlays 2 жыл бұрын
Thank you for this!
@meat_kid
@meat_kid Жыл бұрын
Good stuff, but man this it a lot all at once. As someone who only has the basics of javascript i found this to be really overwhelming and fast paced
@Bueno_Burger
@Bueno_Burger Жыл бұрын
When I try to test run it it keep saying "npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead." I dumb and have no idea what this means. Someone please help.
@zakleby2835
@zakleby2835 Жыл бұрын
It’s nothing to worry about
@thomas_gk513
@thomas_gk513 Жыл бұрын
ReferenceError: folder is not defined i get this error here and idk why
@Chvse16
@Chvse16 Жыл бұрын
The bot only responds to the ping command once..then it says application failed to respond on discord when tried for the second time
@ForwardEn_
@ForwardEn_ Жыл бұрын
Check If You Typed Something Wrong
@ashtongumpert3715
@ashtongumpert3715 6 ай бұрын
Hey I don't know if this is kept up with but I get this error when launching the bot Cannot find module './src/functions/handlers/handleCommands.js' any ideas of why?
@cainothecreator8363
@cainothecreator8363 5 ай бұрын
I know this is two weeks old, but just in case it isn't fixed yet I have two potential fixes. One, check to make sure you are using the correct version of js. If your version is outdated some functions may not work correctly. Second make sure that the exact spelling of the directory (all folders from the source file) and the string being passed into the function are a 100% match. Finally check the video again. I don't remember off the top of my head but isn't there meant to be like a $ at the start of the string? (I haven't watched this in like 6months.)
@appleateshoe2877
@appleateshoe2877 Жыл бұрын
whenever i test it, it keeps telling "no test specified" and idk how to fix it
@SirJul
@SirJul Жыл бұрын
5:47 here he explains what to do, its cause you havent specified "test" in the scripts section. hope that helps you
@NekoJax
@NekoJax Жыл бұрын
Its a good tutorial.. but for your nexzt tutorial please try explaining the reason why we're doing x thing, its honestly really confusing in my opinion
@harishbalasubramanian78
@harishbalasubramanian78 10 ай бұрын
Thanks!
@bamOCE
@bamOCE Жыл бұрын
I keep getting Error, the application didn't respond when using the /ping command I double checked and my code should be working but im not too sure.
@wunguh
@wunguh Жыл бұрын
also received this
@jstn9538
@jstn9538 Жыл бұрын
when I try to test run it, it says: "TypeError [ClientMissingIntents]: Valid intents must be provided for the Client." What is the problem?..
@n.w.a_caillou2366
@n.w.a_caillou2366 Жыл бұрын
you must enable the intents for you bot in the developer portal
@dayshag5257
@dayshag5257 Жыл бұрын
can you do commands with prefix?
@nolanschaale1301
@nolanschaale1301 Жыл бұрын
bruh I need to start watching these at like half speed you guys always move so fast
@jordanperrin335
@jordanperrin335 Жыл бұрын
it would be cool if you split the video into different chapters
@levisonexe
@levisonexe Жыл бұрын
Is it possible to make prefix commands
@jikeybear
@jikeybear Жыл бұрын
if you error in for (const file of commandFiles) { just change commandFiles to commandFolders :3
@endermanmaster4294
@endermanmaster4294 Жыл бұрын
when running npm test it says "eventsFolders is not defined" anyone know how to fix it?
@zacharymadden8634
@zacharymadden8634 Жыл бұрын
if it's the ready.js file giving you trouble, create a new folder in the 'events' folder and drop the file in there. Or whichever. It's finding the file and treating is a folder when it's not supposed to
@zxy8057
@zxy8057 Жыл бұрын
It would be helpful if you could explain what youre actually doing and the definitions of the terms. 6/10
@tobers_j
@tobers_j Жыл бұрын
When I try to run the code to start the bot it keeps just saying Error: ENOENT: no such file or directory, scandir './src/functions/${folder}' I have made sure that my code and structure is the same as his. Does anyone have a solution?
@jessekkemp
@jessekkemp Жыл бұрын
I have the same problem, let me know if you find the fix!
@BennyTheBee
@BennyTheBee Жыл бұрын
Make sure to change the ' to `. So instead of quote, to tilda. @jvsse
@BennyTheBee
@BennyTheBee Жыл бұрын
@@jessekkemp See above
@karoonatrip
@karoonatrip Жыл бұрын
@@BennyTheBee thank you!
@amasinamr6046
@amasinamr6046 2 жыл бұрын
12:59 preferred zoom-in
@thedog8668
@thedog8668 4 ай бұрын
I made everything from tutorial but it says: > discord-bot@1.0.0 test > echo "Error: no test specified" && exit 1 "Error: no test specified" Can anyone help me please?
@waggerra
@waggerra 4 ай бұрын
Alternative1: Do node src/index.js or src/bot.js. Alternative 2: Install nodemon do npm install nodemon Then launch nodemon with "nodemon" Nodemon is a thing that allows you to restart your bot everytime you do CTRL + S. Your problem is that you haven't set your start command in the config.json file (I think, not sure because im new )
@0xxzeus811
@0xxzeus811 Жыл бұрын
Am getting this error when I run "npm run test" const { token } = process.cnv; ^ TypeError: Cannot destructure property 'token' of 'process.cnv' as it is undefined. at Object. (C:\Users\USERP\Desktop\TheGafferBot\src\bot.js:2:9) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 please help fix this
@petergg9096
@petergg9096 Жыл бұрын
You made a small mistake. You need to replace process.cnv with process.env 😊
@bre4kf4st-
@bre4kf4st- 8 ай бұрын
i tested the code but if i used that then the bot dont react
@wirtualnipiloci
@wirtualnipiloci Жыл бұрын
Error: ENOENT: no such file or directory, scandir './src/function/handlers'
@darinwolyniec
@darinwolyniec Жыл бұрын
function -> functions
@DonoNut1
@DonoNut1 11 күн бұрын
Error: Cannot find module 'dotenv'?
@DanSpared
@DanSpared Жыл бұрын
it says that it doesnt recognise dotenv
@cwdoby
@cwdoby Жыл бұрын
If this is supposed to be for a beginnier, not gonna lie, it's way too fast and hard to follow. But I can tell you are trying to do this right.
@officialdreamplayz
@officialdreamplayz Жыл бұрын
nice tutorial
@viktore8703
@viktore8703 Жыл бұрын
23:04 When i start i'm getting error: ReferenceError: Discord is not defined at Object. (C:\Users\iakmn\OneDrive - abc\Desktop\Coin System\src\bot.js:7:16) at Module._compile (node:internal/modules/cjs/loader:1097:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10) at Module.load (node:internal/modules/cjs/loader:975:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
@ryancoble8776
@ryancoble8776 Жыл бұрын
I think there's some un-needed complexity, at least for beginners. I think you could have simplified it by not dynamically loading the commands. You could have also loaded all the commands with one loop instead of looping through each folder, then each subfolder/file. All in all though it's a good display of skill and good for people with a previous engineering background.
@yuvamgupta4150
@yuvamgupta4150 Жыл бұрын
Please make a tutorial in which you explain everything
@mrvenomyt69
@mrvenomyt69 2 жыл бұрын
Unable to make subcommands can you help me out
@V9Void
@V9Void Жыл бұрын
ZOOMED IN :}
@ainnunhere
@ainnunhere Жыл бұрын
I need help it always says no such file or directory, scandir ‘./scr/function’
@Jzoldyck
@Jzoldyck Жыл бұрын
you found a solution? mb, only i forgot to put ";"
@stretchyyawn713
@stretchyyawn713 5 ай бұрын
bruh you go so damn fast
@stowing
@stowing Жыл бұрын
copied the whole vid and yet I get an error saying. node:internal/fs/utils:344 throw err; ^ Error: ENOENT: no such file or directory, scandir './src/functions/${folder}' Tried looking over the vid and nothing in my code is wrong so I don't get it. Would love an explanation.
@stowing
@stowing Жыл бұрын
this is my bot.js require("dotenv").config(); const { token } = process.env; const { Client, Collection, GatewayIntentsBits, GatewayIntentBits, } = require("discord.js"); const fs = require("fs"); const client = new Client({ intents: GatewayIntentBits.Guilds }); client.commands = new Collection(); client.commandArray = []; const functionFolders = fs.readdirSync("./src/functions"); for (const folder of functionFolders) { const functionFiles = fs .readdirSync('./src/functions/${folder}') .filter((file) => file.endsWith('.js')); for (const file of functionfiles) require('./functions/${folder}/${file}")(client)'); } client.handleEvents(); client.handleCommands(); client.login(token);
@He.is.George_Fox
@He.is.George_Fox Жыл бұрын
I like how he said *reddirSync*
@flvffywvffy
@flvffywvffy 2 жыл бұрын
I keep getting this error: TypeError: interaction.isChatInputCommand is not a function
@raracool04
@raracool04 Жыл бұрын
make sure its interaction.isChatInputCommand() with the brackets
@MatthewBaka
@MatthewBaka Жыл бұрын
When I made a bot in Python, I only had to add 3 or 4 lines of code and then the rest was the logic of the bot. The fact that there's so many folders and lines of code for JS is annoying to type all out.
@YukiGersaniba
@YukiGersaniba 7 ай бұрын
You don't actually need all of this code for the bot, it's actually only about the same amount in JS. It was this much to prepare for the future.
@Aryan-vn3ls
@Aryan-vn3ls 2 ай бұрын
can anyone share the source code of this complete tutorial ..
@GangRX
@GangRX Жыл бұрын
TypeError: Cannot read properties of undefined (reading 'Guilds') why do i keep getting this error
@kannaoki
@kannaoki Жыл бұрын
Same
@kacperNFS
@kacperNFS Жыл бұрын
Can you somehow replace the require(..) when searching for paths? My typescript setup doesn't allow it.
@user-hk7px1sx4x
@user-hk7px1sx4x Жыл бұрын
use import for mjs/ts
@shubham3937
@shubham3937 Жыл бұрын
​@@user-hk7px1sx4x can you explain a Lil bit ?
@qeaper1205
@qeaper1205 Жыл бұрын
lol bro why would you import and export your files like that? Just require them using require()
I Hacked a Discord Bot, the Owner said this...
9:09
No Text To Speech
Рет қаралды 1,1 МЛН
Ruining Discord Servers with a Bot Exploit!
9:32
No Text To Speech
Рет қаралды 425 М.
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 29 МЛН
마시멜로우로 체감되는 요즘 물가
00:20
진영민yeongmin
Рет қаралды 29 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 1,6 МЛН
[NEW] Button Builder GUIDE || Discord.JS v14
13:28
Fusion Terror
Рет қаралды 31 М.
I tried Discord Bot Makers...
14:19
FaceDev
Рет қаралды 99 М.
[NEW] Embed Builder GUIDE || Discord.JS v14
9:36
Fusion Terror
Рет қаралды 43 М.
I beat rigged giveaways with a bot
3:43
Kian Brose
Рет қаралды 1,9 МЛН
How to make a Discord Bot for Beginners (Discord.js v14)
27:29
Under Ctrl
Рет қаралды 314 М.
БЕСТРАШНЫЙ ШКОЛЬНИК НА ВЕЛОСИПЕДЕ #shorts
0:11
One moment can change your life ✨🔄
0:32
A4
Рет қаралды 18 МЛН
Мужчина выростил лук в бутылке
0:56
Бимс
Рет қаралды 5 МЛН
Este tobogán es mío 😡
0:46
Yoila y Teey
Рет қаралды 17 МЛН