[2024] How To Make A Discord Bot For Beginners | Complete Setup | Discord.js v14

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 126

  • @JishanKharbanda
    @JishanKharbanda  ปีที่แล้ว +7

    Watch Next: How to Run Slash Commands on your Discord Bot ►► th-cam.com/video/L-Gf2gPVscc/w-d-xo.html

    • @sammyvrgtag
      @sammyvrgtag หลายเดือนก่อน

      Hey I am having an issue because your going to fast and it goes away not even a little bit after you do a line of code

  • @endispiri3412
    @endispiri3412 11 หลายเดือนก่อน +4

    after hundreds of videos that i have seen, this is the only one that worked. THANKS!!!

  • @fazezenh4237
    @fazezenh4237 ปีที่แล้ว +6

    I can't get my bot online it just says
    referenceError : GatewayIntentBits is not defined at object . then my pc desktop one drive then the folder name and it says src/index.js : 2:32 then it runs and comes up with node.js v18.17.1

  • @kaspyrr
    @kaspyrr 6 หลายเดือนก่อน +5

    To anyone still struggling with the invalid token error, move .env to the main folder. it wont work properly when its inside the same folder as your index.js file. Hope this helps!

    • @TheJgamer09
      @TheJgamer09 2 หลายเดือนก่อน

      thank you this really helped me

  • @shawncalverley6915
    @shawncalverley6915 ปีที่แล้ว +4

    Thank you for making a good video on how to do this because I was really having trouble finding anything decent!

  • @osmos_
    @osmos_ ปีที่แล้ว +2

    Finally, a good video on how to do this! Thank you!

  • @babykosh5415
    @babykosh5415 10 หลายเดือนก่อน

    beautiful vid bro. if you are on linux try doing the npm init first and then the install

  • @Mrcrzytornado1
    @Mrcrzytornado1 ปีที่แล้ว

    4:11 you dont need to paste it into the chat, you can just paste it into your web browser and invite it there. This is just for information, i am not suggesting anything to persuade your choice.

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว

      Good point. You can indeed paste the OAuth2 URL (the bot invite link) in a web browser if you find that more convenient.

  • @ttvgalaxygameryt1691
    @ttvgalaxygameryt1691 ปีที่แล้ว +1

    Great video fr 🐐

  • @AimDaCrazyOne
    @AimDaCrazyOne 5 หลายเดือนก่อน +1

    bro they updated the oauth thing and now it requires some stupid uri thing

  • @redfish_yt
    @redfish_yt ปีที่แล้ว +1

    I found this useful for my dc server 🔥

  • @goncalofrutuoso656
    @goncalofrutuoso656 ปีที่แล้ว +3

    Great tutorial! Just one tip dont use requiere anymore in js, use mjs files and use imports. I know sometimes its hard getting used to it, but its the new thing!

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว +2

      Thanks for watching! And yeah, you do bring up a good point regarding using 'imports' with ECMAScript modules (ESM) as it's the new thing in JS. However, in the tutorial, I used 'require' since I find it more conventional and compatible for Discord.js-related projects.

  • @IoFPV
    @IoFPV ปีที่แล้ว

    Thank you man your video really helped me

  • @alejandroperez1227
    @alejandroperez1227 ปีที่แล้ว +2

    10:33 what did he do? i went over the code again and it’s saying error

  • @redfish2x
    @redfish2x ปีที่แล้ว +1

    Super useful 🔥🔥

  • @shotsbysvft2k
    @shotsbysvft2k ปีที่แล้ว +1

    Great tutorial ❤

  • @D13G0RV0fficial
    @D13G0RV0fficial ปีที่แล้ว

    i have a question what is the package-lock.json for ?

  • @elicook-ef4pw
    @elicook-ef4pw 5 หลายเดือนก่อน

    Error: Cannot find module 'C:\Users\eliga\Desktop\code\code1\index.js'. Please verify that the package.json has a valid "main" entry
    just got another error:
    TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
    Please help

  • @BillySon-ob9wz
    @BillySon-ob9wz ปีที่แล้ว

    Nice video!

  • @heut28
    @heut28 9 หลายเดือนก่อน

    Hello!
    I've got a question; whenever i do the final step and "edit" the program after we already made the bot online, it's getting offline. I can't seem to find an answer as to why this is happening, as i followed every step correctly.

  • @Wyatt_Hud_wrestling
    @Wyatt_Hud_wrestling 9 หลายเดือนก่อน +1

    When I do the part at time stamp 10:10 it says
    "node : The term 'node' 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
    + node .
    + ~~~~
    + CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"
    can I get sum help😐.

    • @1BigTuna1
      @1BigTuna1 6 หลายเดือนก่อน

      i had the same error and all i did was save everything and restart the application
      it seems that when i opened visual studio code , node was still installing

  • @1ncuburst
    @1ncuburst 9 หลายเดือนก่อน +1

    When I type “node .” In the terminal it just brings me right back to the folder, it doesn’t say “Bot is ready!” and it doesn’t give me an error code either :( idk what to do

    • @s87272
      @s87272 4 หลายเดือนก่อน

      late reply, sorry. hopefully u got it fixed now, but the solution is to restart your computer to fully install node.js, then try running it again. worked for me

  • @SolitudeYT1
    @SolitudeYT1 ปีที่แล้ว

    Useful vid!

  • @versenetic
    @versenetic ปีที่แล้ว

    Nice MrJAwesome tutorial

  • @pancakess839
    @pancakess839 7 หลายเดือนก่อน

    I'm being stuck at this error
    Please verify that the package.json has a valid "main" entry
    whenever I try to save it I just follow the steps in the video I don't know if I'm doing it right

  • @BabyGloxkTv
    @BabyGloxkTv ปีที่แล้ว

    Nice Video 🔥

  • @fazezenh4237
    @fazezenh4237 ปีที่แล้ว

    My one is saying referenceError : GatewayIntentBits is not defined at object . then my pc desktop one drive then the folder name and it says src/index.js : 2:32 then it runs and comes up with node.js v18.17.1

  • @hazazi3177
    @hazazi3177 ปีที่แล้ว

    I hope if you may can explain whats mean const and those stuff I mean in a tutorial I want to understand what am I doing to learn about that but ill follow you for more tutorials anyway thanks.

  • @chrisgriffioen
    @chrisgriffioen 8 หลายเดือนก่อน

    Ur saying make sure to safe it. how do i safe it ? cuz when i type in node . its still not working.

  • @redfish4short
    @redfish4short ปีที่แล้ว

    Good tutorial ❤

  • @YousifWissam-ql7gs
    @YousifWissam-ql7gs 10 หลายเดือนก่อน

    great job

  • @Fr0xii
    @Fr0xii ปีที่แล้ว +1

    I can tell this is a good tutorial, but I got stuck at 5:10. Every time I put in cd desktop and my file names into command prompt, it always says my system can't find the path specified. I don't know if it's just because I'm using Windows and not iOS like you, or I'm just missing something obvious.

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว

      Hey there. Do you get the path can't be found error when typing "cd desktop"? If so, this is most likely because your "Desktop folder" exists inside of another location, so you would need to 'cd'' into the original location first. You can quickly see where your Desktop folder is located by creating a new file on your Desktop and then right-clicking on "properties" and seeing the file location of your Desktop. Hope this helps!

    • @markinatorbozak4595
      @markinatorbozak4595 10 หลายเดือนก่อน

      ​@@JishanKharbandathanks that helped

  • @psdeshae
    @psdeshae ปีที่แล้ว

    Dope tutorial

  • @history_nerd2006
    @history_nerd2006 ปีที่แล้ว

    Very helpful!

  • @WinstonGarcia-q9e
    @WinstonGarcia-q9e ปีที่แล้ว

    Thanks 🙏

  • @robo7014
    @robo7014 ปีที่แล้ว +1

    You have invalid token and one unclosed bracket on line 7. It hsa to be ) not }

    • @fazezenh4237
      @fazezenh4237 ปีที่แล้ว

      Can you help me it isn't saying my bot Is online

    • @robo7014
      @robo7014 ปีที่แล้ว

      @@fazezenh4237 what's the error

  • @juaniferreira4265
    @juaniferreira4265 ปีที่แล้ว

    niceeeeee thanks!

  • @OP_ARI69
    @OP_ARI69 5 หลายเดือนก่อน

    I like your video but please explain what's going on in the code

  • @SamPoint-r5m
    @SamPoint-r5m ปีที่แล้ว

    Nice!

  • @Doors-nice7777
    @Doors-nice7777 11 หลายเดือนก่อน

    10:29 I saved everything and I am still getting the exact same error, please help with this!

  • @a_15_z32
    @a_15_z32 7 หลายเดือนก่อน

    bro help it asks me to put in a uri direct, idk what that is

  • @Ayrin69
    @Ayrin69 ปีที่แล้ว

    bro it says invalid token when i type node . then press enter. what do i do???

  • @BabyySpin
    @BabyySpin ปีที่แล้ว

    Awesome

  • @azula6184
    @azula6184 10 หลายเดือนก่อน

    i cant get past 5:25 , it cannot find cd DiscordBots even tho i made it

  • @niceland9488
    @niceland9488 ปีที่แล้ว

    Its helpful

  • @nivre_ix
    @nivre_ix ปีที่แล้ว +1

    my discord.js is installing but it isnt going into my created folder

    • @rblxluke
      @rblxluke ปีที่แล้ว

      did you run npm init -y

  • @eternaldark3472
    @eternaldark3472 ปีที่แล้ว +1

    It says invalid token after i did the last part

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว

      Hello, make sure you correctly copied your token from your index.js file to your .env file and accurately updated your index.js file with the token variable.

  • @PiorunixYT
    @PiorunixYT 11 หลายเดือนก่อน

    Can you help me. why in first line console show error with require "require is not defined" i have the same code as you

    • @Fluoride9999
      @Fluoride9999 10 หลายเดือนก่อน

      In package.json, set the "type" field to "commonjs". Create it if it doesn't exist.

  • @candypow5
    @candypow5 ปีที่แล้ว

    i did this tutorial 12 times wondering why it kept saying 'Please verify package.json has a valid "main" entry' only to realise just now i put scr instead of src for the folder and src for the package.json. I have no idea how i did this 12 times in a row

    • @candypow5
      @candypow5 ปีที่แล้ว

      great now i have a new error after i fixed it "error: new Error("Used disallowed intents")"

    • @candypow5
      @candypow5 ปีที่แล้ว

      with a quick google search fix it i am smart

    • @candypow5
      @candypow5 ปีที่แล้ว

      i am now a computer expert

  • @JustFard
    @JustFard ปีที่แล้ว

    I know this was uploaded a while ago but I have inserted all of the index. js and when i run the command "node .
    I get...
    SyntaxError: Unexpected token '{'
    This was done on discord js 14.12.1 however you did it on 14.11 so either the update had muddled the code up or I did something wrong.
    EDIT: I figured out the problem!

    • @immuchh
      @immuchh ปีที่แล้ว

      Pls do tell

    • @fazezenh4237
      @fazezenh4237 ปีที่แล้ว

      My one is saying referenceError : GatewayIntentBits is not defined at object . then my pc desktop one drive then the folder name and it says src/index.js : 2:32 then it runs and comes up with node.js v18.17.1

  • @potato5102
    @potato5102 ปีที่แล้ว

    mine says used disallowed intents pleasee help

  • @skillzninjaz7103
    @skillzninjaz7103 ปีที่แล้ว

    Nice

  • @roachy4262
    @roachy4262 ปีที่แล้ว

    Just a quick question. The last set of code (x.user.tag) does it let the bot show it's online 24/7

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว

      No, the last set of code simply outputs to the console the bot's user tag. To make the bot online 24/7, you would need to run your program locally (on your computer) all the time or host it on a cloud platform like Replit.

  • @mookc-1378
    @mookc-1378 ปีที่แล้ว

    Great

  • @lavazhul
    @lavazhul 9 หลายเดือนก่อน

    i made a typo and spent an hour trying to fix it

  • @Gst_0918
    @Gst_0918 ปีที่แล้ว

    " node : The term 'node' 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
    + node .
    + ~~~~
    + CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException " can someone help me out at the end i just copied him in eve but idk whats the problem here pls..

    • @alejandroperez1227
      @alejandroperez1227 ปีที่แล้ว

      Same issue ever find a solution?

    • @Gst_0918
      @Gst_0918 ปีที่แล้ว

      nah i just talked to my friend and made another one@@alejandroperez1227

    • @mateotsu
      @mateotsu ปีที่แล้ว

      Same issue

    • @Wyatt_Hud_wrestling
      @Wyatt_Hud_wrestling 9 หลายเดือนก่อน

      Same issue.

    • @bolo_3042
      @bolo_3042 4 หลายเดือนก่อน

      same issue

  • @hdr_8
    @hdr_8 8 หลายเดือนก่อน

    5:11 Why does my thing not work i tpyed "cd Desktop" "~ % cd Desktop", "-cd Desktop" Am I missing something?

    • @lxra5329
      @lxra5329 2 หลายเดือนก่อน

      type "cd OneDrive" before "cd Desktop"

  • @kenjiwakabayashi8794
    @kenjiwakabayashi8794 ปีที่แล้ว

    Bro, When I put "node ." on terminal it have a problem. It say the term "node" is not recognized as the name of a cmdlet, function, script file.

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว

      This error is indicative that you have either not installed Node.js or have installed it in the wrong path. If you have already installed Node.js, try uninstalling it and reinstalling it (the LTS version) and choose the option along the lines of "add to PATH" during installation. This should resolve the issue, hope this helps!

  • @Minimumwage22
    @Minimumwage22 ปีที่แล้ว +1

    keep getting syntax error unexpected token '{'

    • @SABS-sr1gy
      @SABS-sr1gy ปีที่แล้ว

      did you figure it out

    • @SABS-sr1gy
      @SABS-sr1gy ปีที่แล้ว

      i'm stuck on that too

  • @Muteeb_Tech
    @Muteeb_Tech ปีที่แล้ว

    good

  • @rayny2775
    @rayny2775 ปีที่แล้ว

    Hey there,
    Upon creating the terminal and entering "node .", i get this error message...
    node:internal/process/promises:289
    triggerUncaughtException(err, true /* fromPromise */);
    ^
    ConnectTimeoutError: Connect Timeout Error
    at onConnectTimeout (C:\Users\Ryan\Downloads\ODDS ON
    ode_modules\undici\lib\core\connect.js:182:24)
    at C:\Users\Ryan\Downloads\ODDS ON
    ode_modules\undici\lib\core\connect.js:129:46
    at Immediate._onImmediate (C:\Users\Ryan\Downloads\ODDS ON
    ode_modules\undici\lib\core\connect.js:168:33)
    at process.processImmediate (node:internal/timers:478:21) {
    code: 'UND_ERR_CONNECT_TIMEOUT'
    }
    Node.js v20.8.1
    Please help!!!

  • @sei9268
    @sei9268 ปีที่แล้ว

    Nice video but how can i make it always online? I try to use replit but it still offline

    • @Kerosene6969
      @Kerosene6969 ปีที่แล้ว

      the bot will not work until u turn on ur relit application
      for tht u need to find and use a 24/7 mod to make it work without being offline which is pretty hard to do. hope it helped. :)

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว

      You can use cloud/cloud-based platforms (such as Replit or Heroku) to run and host your bot and keep it always online. It's worth noting though, that Replit scripts usually time out after 1 hour of inactivity causing your bot to go offline. To fix that, you can set up an HTTP web server (through an application such as UpTime Robot) that will send constant pings to your Replit script every 5 minutes, keeping your bot always online. Hope this helps!

  • @thomass1821
    @thomass1821 ปีที่แล้ว

    Hello! I got a question. When I tried installing node js, 5 options popped up in the node js window and i didn't know which to install:
    "Node.js runtime"
    "corepack manager"
    "npm package manager" (the one I tried but didn't work)
    "Online documentation shortcuts"
    and
    "Add to PATH"
    WHICH ONE OF ALL THE ABOVE DO I HAVE TO INSTALL???
    Thanks! Have a great day!

    • @candypow5
      @candypow5 ปีที่แล้ว

      i think installed Node.js runtime but i can't remember it was the first option

  • @fiv5792
    @fiv5792 ปีที่แล้ว

    Anyone knowing how to make it be online always?

  • @fadmountlake
    @fadmountlake ปีที่แล้ว

    how to save package.json 10:25 ?

    • @JishanKharbanda
      @JishanKharbanda  ปีที่แล้ว

      In this case, you can simply save the package.json file by using the keyboard shortcut "CTRL/CMD S".

  • @Kyo6212
    @Kyo6212 ปีที่แล้ว

    4:41

  • @gemclones
    @gemclones ปีที่แล้ว

    this was to nerdy for me def not for beginners idk how to get to 5:16

  • @allyelista1998
    @allyelista1998 ปีที่แล้ว

    it says cant read file

  • @superxp55
    @superxp55 ปีที่แล้ว

    Niceeee

  • @its.piggers
    @its.piggers ปีที่แล้ว

    it says error: new error("used disallowed intents")

    • @its.piggers
      @its.piggers ปีที่แล้ว

      fixed it

    • @potato5102
      @potato5102 ปีที่แล้ว

      please tell me how you fixed it

    • @blebnk3866
      @blebnk3866 10 หลายเดือนก่อน

      how you fix that???

  • @jonesgaming254
    @jonesgaming254 ปีที่แล้ว

    cool

  • @EKIABLENDER
    @EKIABLENDER 8 หลายเดือนก่อน

    Hello. After following the tutorial. i got this error.
    node:internal/process/promises:289
    triggerUncaughtException(err, true /* fromPromise */);
    ^
    [Error: 44110000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl
    ecord\ssl3_record.c:355:
    ] {
    library: 'SSL routines',
    reason: 'wrong version number',
    code: 'ERR_SSL_WRONG_VERSION_NUMBER'
    }
    Node.js v20.11.1
    Hope someone can help.

  • @Kouxyz
    @Kouxyz ปีที่แล้ว

    "Tokeninvalid"

  • @caseymcpro5338
    @caseymcpro5338 9 หลายเดือนก่อน

    AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
    NOT WORKING

  • @benitoocampo7987
    @benitoocampo7987 ปีที่แล้ว

    ❤❤❤

  • @truykichoffical8674
    @truykichoffical8674 ปีที่แล้ว

    installed

  • @filmyguyyt
    @filmyguyyt ปีที่แล้ว

    Hey :-)

  • @Coems_sniper
    @Coems_sniper 11 หลายเดือนก่อน +3

    Not working. Dislike

  • @hernilopez7782
    @hernilopez7782 ปีที่แล้ว

    🙏🙏

  • @Fxmous-r6l
    @Fxmous-r6l ปีที่แล้ว

    ❤❤❤