How to Build a Discord Bot - Full JavaScript Chatbot Tutorial

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

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

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

    10:15 client.guilds.cache.forEach()
    10:44 guild.channels.cache.forEach()
    12:00 let generalChannel = client.channels.cache.get()
    12:40 const attachment= new Discord.MessageAttachment()
    18:36 let customEmoji=recievedMessage.guild.emojis.cache.get()

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

    If you are having issues... Following the video DOES work if you just go to 11:03, everything works following the steps in the video plus what Secrets said which is every time you have to write a forEach statement, right before it between it and guilds/channels you need to put .cache, so instead of client.guilds.forEach.... it is client.guilds.cache.forEach, same with guild.channnel.cache.forEach

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

      Thank you man, I was not able to continue as I couldn't get the general channel ID. Thank you sooo much!!

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

      Thx Thx Thx Thx Bro ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️😍

    • @slybandit8117
      @slybandit8117 3 ปีที่แล้ว

      Yea no worries. I actually found this in another post aka it wasn’t me who figured it out, but the post wasn’t here (I forget where) and since I tried it and it worked I figured people need to know.

    • @abhijitmanna4524
      @abhijitmanna4524 3 ปีที่แล้ว

      Thank you for this correction

    • @abhijitmanna4524
      @abhijitmanna4524 3 ปีที่แล้ว

      i am also facing same issue at 13:09 at 19th line what to do ?

  • @Yours--Truly
    @Yours--Truly 5 ปีที่แล้ว +8

    Finally it's explained how to make a discord bot. Thank you

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

    10:38 anyone noticed he laughed a lil bit while speaking? 😂
    Nice video tho

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

    13:15 I get an ReferrecnceError : MessageAttachment is not defined. Any help??

    • @chilledcoder3610
      @chilledcoder3610 4 ปีที่แล้ว

      yes at the beggining type
      const MessageAttchment = require('discord.js');
      if u need more help join ma discord

    • @thinkingmad1685
      @thinkingmad1685 3 ปีที่แล้ว

      I guess now instead of discord. Attachment it's discord.messagaAttachment. however I m late to ans your query because I m watching it now

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

    Note for all devs watching this video in 2020-2021:
    please put .cache after .guilds or .guild..cache
    discord has updated this so you might run into errors if you don't put it

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

    This channel is blessing for js devs.

    • @hassanzahoorraja9287
      @hassanzahoorraja9287 6 ปีที่แล้ว

      Muhammad Quanit bhai online games k lye bot ban sakta hy kya?

    • @mquanit
      @mquanit 6 ปีที่แล้ว

      @@hassanzahoorraja9287 Article related to games bot....
      recast.ai/blog/bot-in-video-games/
      check it out

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

    In 7:46 while testing out the first code. Why did it work when i saved the code as my_bot.js but didnt work when i saved it as mybot.js

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

    That was awesome. Loved it. I had my very first bot ready. Playing with documentation now for further customization.

    • @hassanzahoorraja9287
      @hassanzahoorraja9287 6 ปีที่แล้ว

      Muhammad Tahir Khan online games ka bot ban sakta hy?

    • @itahirk
      @itahirk 6 ปีที่แล้ว

      @@hassanzahoorraja9287 Ban skta hy, laikin itni asaani sy bilkul nahi.

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

    Love this channel man💪

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

    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.

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

      I would say the difference is negligible between Node.js and Python when it comes to speed and performance of a Discord bot. JavaScript is a good choice for async applications. They will be roughly on the same order of magnitude as opposed to something like Go or Java which could see a large increase in performance if it was *really* busy. I would recommend the discord.js library over discord.py just because it's in the middle of a rewrite and Python 3.7 broke a lot of the code because of their async changes and people often get frustrated when they realize they have to downgrade to 3.6.

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

    My code at 7:58 doesn't work. I tried everything u said in the vid as well as the comments.
    HELP!

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

    *I have put in the code as given by DevDungeon. But when I put it into the terminal, it just enters into the next line. What do I do?*

    • @MERP6969
      @MERP6969 4 ปีที่แล้ว

      that happed to me

    • @gmaster5518
      @gmaster5518 4 ปีที่แล้ว

      Was watching this video had same issue but I believe it can be fixed using... new Discord.MessageAttachment(" ")

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

      save the script before running

    • @javydones6814
      @javydones6814 4 ปีที่แล้ว

      @@Nifler192 It's like me designing videogames on Batch XD

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

    7:58 I try to run it but it comes up as "discord not defined"

    • @SpaceflightRocketShorts
      @SpaceflightRocketShorts 4 ปีที่แล้ว

      nvm changed the code a bit and worked

    • @jamesw8588
      @jamesw8588 4 ปีที่แล้ว

      This happened to me when I didn't capitalize Discord in line 1

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

    Finally someone made this! Discord's tutorial they had on their site, was confusing!

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

    I have a problem, i don't see cdm anywhere, there is just powershell.

  • @9yearoldsoldier345
    @9yearoldsoldier345 6 ปีที่แล้ว +23

    Welp, after following your intructions to a tee, I am unable to get the bot online and get the message at 7:58

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

      Seems like you forgot a character, look at the video and compare the code with the code you wrote.

    • @Ammarx1
      @Ammarx1 5 ปีที่แล้ว +13

      @Team Aiden:
      When u run node my_bot.js and doesnt work, save the file. I think some people have autosave on

    • @mizakiopia
      @mizakiopia 4 ปีที่แล้ว

      I am also having this issue as well with an "TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received an
      instance of Array"

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

      take my i have same problem do this
      const Discord = require('discord.js')
      const client = new Discord.Client()
      client.on('ready',() => {
      console.log("Connected as " + client.user.tag)
      })
      client.login("xxxx")

    • @1Connor
      @1Connor 4 ปีที่แล้ว

      @@Ammarx1 thank you so f,ing much

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

    Just when I thought I was beginning to understand JS, now I see this...
    ...I won't give up though...

    • @ajitsakri9888
      @ajitsakri9888 4 ปีที่แล้ว

      you are better than people who blindly follow tutorials

    • @ajitsakri9888
      @ajitsakri9888 4 ปีที่แล้ว

      I even don't have any clue

    • @Taemo
      @Taemo 4 ปีที่แล้ว

      @@ajitsakri9888 same

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

    5:40 "it should automatically put you in the directory you are working in"
    In my case it doesn't, how do i reach that directory in terminal

    • @chetan9533
      @chetan9533 4 ปีที่แล้ว

      I just moved my "my bot.js" to the path it was showing in the terminal to make it work for the time being but i'd still like to know how to move within directories using terminal

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

      @@chetan9533 Usually when you open terminal, it puts your current directly as your home folder. Type " ls " into terminal and press enter. You'll see every file and folder in the current working directory (it'll probably show all the files in your home folder). To select a folder to work in (for example, the Documents folder), you're going to want to type " cd Documents ". If nothing pops up, and the next line awaits input and shows you're in the Documents folder, you're good. (All those commands are without the quotation marks)

    • @chetan9533
      @chetan9533 4 ปีที่แล้ว

      @@themixxremixx i know these commands but they weren't working in vs code terminal and command prompt even though they were working fine in git bash. Actually there was a path issue, i added git and vs code's bin folders to the path in environment variables. Now those commands work in vs code terminal and command prompt as well. Was kind of a headache but glad i made it through.

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

    to get a channel id without using the channel id command - right click on channel then copy id
    works on on your own server
    ps, just to save time

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

    It's showing an error message(Module not found) when I input, node (bot name).js

    • @YukiGersaniba
      @YukiGersaniba 4 ปีที่แล้ว

      Can I have the code? Be sure to hide your token.

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

      this is happening to me too

    • @YukiGersaniba
      @YukiGersaniba 4 ปีที่แล้ว

      hongjoong *did you install discord.js?*

    • @drippykevin437
      @drippykevin437 4 ปีที่แล้ว

      Yuki Gersaniba yeah

    • @YukiGersaniba
      @YukiGersaniba 4 ปีที่แล้ว

      hongjoong *in your bot folder?*

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

    Very informative. I plan on coming back here eventually. Thank you very much for this video

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

    'npm' is not recognized as an internal or external command,
    operable program or batch file.

    • @computer9930
      @computer9930 5 ปีที่แล้ว

      nvm i got it

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

      @@computer9930 how did you fix it?

    • @eva1uate680
      @eva1uate680 3 ปีที่แล้ว

      @@computer9930 I have the same error, how do I fix it?

    • @vyliad
      @vyliad 3 ปีที่แล้ว

      how do i fix it?

  • @Donmykl
    @Donmykl 6 ปีที่แล้ว

    This channel is amazing...don't know javascript but I could keep up with your tutorial keep up the good work!

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

    after i tried everything i steel can not do what he did in 10:22 someone help me

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

      I know this is a month later but instead of client.guilds.forEach type client.guilds.cache.forEach (same for the channel function. guilds.channels.cache.forEach)

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

      @@ashtonjavier8151 do you have discord? I need help xd

    • @ashtonjavier8151
      @ashtonjavier8151 4 ปีที่แล้ว

      @@teodora214 Yeah Viridity#2003

    • @teodora214
      @teodora214 4 ปีที่แล้ว

      @@ashtonjavier8151 Add me pls Teodora#8778

    • @ashtonjavier8151
      @ashtonjavier8151 4 ปีที่แล้ว

      @@teodora214 added

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

    Discord a great platform for any gamer!

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

    remember guys, if it says no module found, type in this in the terminal:npm init

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

    Love this.. channel..some one tell me mathematics subject career..

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

    anyone help me at 12:12 it gives errer please help or sent a copy if you have done it

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

      let generalChannel = client.channels.cache.get(" CHANNEL ID ")
      generalChannel.send("Hello, World!")

    • @inononeeee
      @inononeeee 4 ปีที่แล้ว

      @@mikoaj3539 thanks

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

    if you dont see any response as "Connected as bot" and instead it takes you to the next line, save the current task and restart the visual studio and type again.. mine worked this way

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

      thank you, you saved me so much frustration

    • @lekanak4109
      @lekanak4109 4 ปีที่แล้ว

      Now I'm getting a reference error saying discord is not defined

    • @folliejester
      @folliejester 4 ปีที่แล้ว

      @@lekanak4109 npm i discord.js in cmd or terminal

    • @lekanak4109
      @lekanak4109 4 ปีที่แล้ว

      @@folliejester It still says discord is not defined

    • @folliejester
      @folliejester 4 ปีที่แล้ว

      @@lekanak4109 pastebin it and show me the program..

  • @TheRoadTaken
    @TheRoadTaken 3 ปีที่แล้ว

    I made it up to 8:16 before encountering a problem. My bot connected but didn't appear in my discord channel on the right side bar as either ONLINE or OFFLINE. The system did say "My Awesome Bot just landed." But when I try to @ my bot, she (my bot is a girl) is not available as a selectable member.
    Node version is 12.16.3
    What did I miss?

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

    Well when I used node (my bot) it didnt mention that it connected nor went online in my server

    • @genericlistokay3148
      @genericlistokay3148 5 ปีที่แล้ว

      did you manage to fix it?

    • @realsn9ke216
      @realsn9ke216 5 ปีที่แล้ว

      @@genericlistokay3148 Nope

    • @eclipse8530
      @eclipse8530 5 ปีที่แล้ว

      @@Dolphin-th6jm THANK YOU SO MUCH

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

    7:56 it keeps saying not found

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

    My bot won't even come online. It does nothing. I have all the correct programs installed and updated but nothing works.

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

    Your channel is fucking amazing!

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

    When i do "node (bot).js" nothing happens. I've checked the code multiple times but it is identical as in the video

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

      do "node (YOUR FILE NAME).js"

    • @aabanshaikh5744
      @aabanshaikh5744 4 ปีที่แล้ว

      do this i also have same problem
      const Discord = require('discord.js')
      const client = new Discord.Client()
      client.on('ready',() => {
      console.log("Connected as " + client.user.tag)
      })
      client.login("xxxx")

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

    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?

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

      Me to!!!!!

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

      Did you check to see if npm was installed on your machine?
      I had the same problem, had node installed but for some strange reason npm wasn't, so I installed it using "sudo apt-get install node -y"
      Then run "npm install discord.js", after that everything should be working smoothly so long as your code doesn't have any erros.
      If this didn't help let me know and I'll provide a different solution, I'm only posting this one because it worked for me...

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

      @@bafana_mhlamvu when I tried to do this my terminal returned "sudo: apt-get: command not found" :(
      Please help!

    • @caitdavies993
      @caitdavies993 5 ปีที่แล้ว

      Never mind! I was writing "npm ___.js" not "node ___.js"!

    • @jspecc_
      @jspecc_ 4 ปีที่แล้ว

      @@bafana_mhlamvu didnt work D:

  • @Ekozaak
    @Ekozaak 5 ปีที่แล้ว

    Thank's, very useful tutorial :)

  • @theboyzgotme8873
    @theboyzgotme8873 4 ปีที่แล้ว

    Can I have the discord link cause the one that you showed is not working and when I was trying to code with node it shows an error.

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

    Bruh everything different in 2021 it outdated how to fix help :(

  • @realbasics
    @realbasics 4 ปีที่แล้ว

    What was the mark he put at 10:51 ?

    • @hayleytymony5903
      @hayleytymony5903 4 ปีที่แล้ว

      this is late but it's the tiny hash looking mark ` that shares the key with this symbol ~

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

    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.

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

      Make sure to save go to file and select autosave

  • @livgeneral6487
    @livgeneral6487 2 ปีที่แล้ว

    When I put new Discord for the attachment part of the tutorial it says TypeError: Discord.Attachment is not a constructor

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

    Great Tutorial, Thanks!!!

  • @Spook_Boi
    @Spook_Boi 3 ปีที่แล้ว

    i currently have a custom dice app that i want to integrate into a discord bot. is there a way to link said diceapp to a bot so i don't have to rewrite code?

  • @spectaculararray6309
    @spectaculararray6309 4 ปีที่แล้ว

    finally i also know to code a bot

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

    '"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.

    • @matdl7139
      @matdl7139 5 ปีที่แล้ว

      I have the same problem.

    • @wickedspiral8598
      @wickedspiral8598 5 ปีที่แล้ว

      Download node.js

    • @abstractsophy
      @abstractsophy 5 ปีที่แล้ว

      De_Struction
      download the tool “node.js”

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

    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?

    • @dwitiyoaritra8271
      @dwitiyoaritra8271 4 ปีที่แล้ว

      Set the Path in environment variables.

    • @22mx82
      @22mx82 4 ปีที่แล้ว +1

      go to file and click save

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

    It sais me that: client.onece is not a function
    Someone can help me?

  • @StalrosTheGreenMage1
    @StalrosTheGreenMage1 5 ปีที่แล้ว

    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

  • @Oelias28
    @Oelias28 4 ปีที่แล้ว

    Hi. Im creating a bot for music.. I write the code but it doesn't play the song.. any help for that?

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

    its saying "ReferenceError: Discord is not defined" Help me out

    • @tushyt
      @tushyt 4 ปีที่แล้ว

      const Discord = require('discord.js')
      const client = new Discord.Client()

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

      If it's at the start of the tutorial, then probably discord.js isn't installed. See this comment:
      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

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

    NO WAYS IT ACTUALLY WORKED

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

    Mcafee is blocking installation of node js saying somebody is trying to hijack your computer

    • @goykovitch
      @goykovitch 3 ปีที่แล้ว

      LoL man someone is hacking ur computer

  • @salmany654
    @salmany654 4 ปีที่แล้ว

    Is this supposed to work with 2020 Development? cause I had two errors that were supposed to be not errors which are "else if" and "{" nearby one of the message for the bot to send so I need help to see what is going on or what I am supposed to put
    Oh also this error "The parser expected to find a '}' to match the '{' token here." Like I didn't copy everything from this video cause my bot is different from this and so I got an error nearby: "lient.on('message', (recievedMessage) => {" and the { is the problem..

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

    7:53 my program just says
    const client = new Discord.client()
    ^
    TypeError: Discord.client is not a constructor

    • @vatsalveerwal1631
      @vatsalveerwal1631 4 ปีที่แล้ว

      it should be Discord.Client(), notice the capital C

    • @uhhhtsmax6660
      @uhhhtsmax6660 4 ปีที่แล้ว

      @@vatsalveerwal1631 same for me, the capital C didn't change anything.

    • @vatsalveerwal1631
      @vatsalveerwal1631 4 ปีที่แล้ว

      @@uhhhtsmax6660 what does it say now? Discord.Client is not a constructor?

    • @aabanshaikh5744
      @aabanshaikh5744 4 ปีที่แล้ว

      do this i also have same problem
      const Discord = require('discord.js')
      const client = new Discord.Client()
      client.on('ready',() => {
      console.log("Connected as " + client.user.tag)
      })
      client.login("xxxx")

  • @MiloD17
    @MiloD17 4 ปีที่แล้ว

    how to make looping i try some code. its run only one time.

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

    I want a tutorial on google wiki and translate.

  • @aidenhess8799
    @aidenhess8799 3 ปีที่แล้ว

    having trouble with .send around the 12 minute mark, any ideas?

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

    Hey guys, how can I check if someone pings?

  • @cincostar7636
    @cincostar7636 4 ปีที่แล้ว

    Im having trouble is the discord sever link still the same??

  • @bastybulawan8567
    @bastybulawan8567 4 ปีที่แล้ว

    how to make the arrow thingy

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

    if u guys are using discord.js v 12 then use
    client.guilds.cache.forEach((guild) => {
    console.log(guild.name);
    });

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

      like ++

  • @pushpanjalinema8493
    @pushpanjalinema8493 3 ปีที่แล้ว

    how to get that channel id ? 11.45

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

    It just says: 'MODULE_NOT_FOUND'

  • @EpicDrake
    @EpicDrake 6 ปีที่แล้ว

    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

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

      You could use a JavaScript library for AIML and implement a chat bot relatively easily. I have a Python Discord chat bot along with tutorials for making the Python Discord bot and the AIML chatbot part separately. www.devdungeon.com/content/chatty-cathy

  • @CraginEdits
    @CraginEdits 4 ปีที่แล้ว

    i am facing error saying forEach is not a funtion

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

    now its just showing me this
    TypeError: Cannot read property 'on' of undefined
    at Object. (C:\Users
    onig\OneDrive\Desktop\my bot\my_bot.js:4:14)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47

    • @romanmettler9733
      @romanmettler9733 4 ปีที่แล้ว

      have you installed discord.js via npm and put this at the start of the file?:
      const Discord = require("discord.js");
      const client = new Discord.Client();
      Client is undefined, thats the problem

    • @TMPKKecskeThe_best_youtuber
      @TMPKKecskeThe_best_youtuber 4 ปีที่แล้ว

      @@romanmettler9733 I have the same problem, I wrote if your advice but it gives me the same error even after only writing in: const Discord = require("discord.js");
      and nothing else. I think it somehow can't find the library.

  • @artin5525
    @artin5525 4 ปีที่แล้ว

    it is work on windows 7 ?

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

    7:58

    • @aabanshaikh5744
      @aabanshaikh5744 4 ปีที่แล้ว

      do this
      do this i also have same problem
      const Discord = require('discord.js')
      const client = new Discord.Client()
      client.on('ready',() => {
      console.log("Connected as " + client.user.tag)
      })
      client.login("xxxx")

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

    Did you tell me how to make a checker bot like am send !chk email:pass ??

  • @proton_2086
    @proton_2086 3 ปีที่แล้ว

    When i start doing it it shows that unexpected token '-'...How do we fix it?

  • @QnMM
    @QnMM 4 ปีที่แล้ว

    When Im writing node.js, there is no message being displayed...moreover the bot is not going online...please help me out

  • @InderoFU
    @InderoFU 3 ปีที่แล้ว

    it doesnt set the activity for me or send hello world or show me all the servers its in, please help

    • @chibuzo_u
      @chibuzo_u 3 ปีที่แล้ว

      I’m stumped too, all I can get to is activity but everything else fails

    • @InderoFU
      @InderoFU 3 ปีที่แล้ว

      @@chibuzo_u the problem is that the video is writing in discord.js v.11, most people have discord.js v.12, it's a version mismatch, watch a more recent guide, this one is unusable unless you use discord.js v.11

  • @techbythadoe2388
    @techbythadoe2388 2 ปีที่แล้ว

    my bot are not connect with my code.i mean cannot find module

  • @flooby_
    @flooby_ 4 ปีที่แล้ว

    I've been following his code to a tee and it comes back with an error "Unexpected end of input"....

    • @flooby_
      @flooby_ 4 ปีที่แล้ว

      now it's saying client.guilds.forEach is not a function-

    • @flooby_
      @flooby_ 4 ปีที่แล้ว

      the error for guilds and channels is below:
      (node:9628) UnhandledPromiseRejectionWarning: TypeError: client.guilds.forEach is not a function
      at Client. (C:\Users
      bb78\Desktop\falconcad_bot\my_bot.js:9:19)
      at Client.emit (events.js:315:20)
      at WebSocketManager.triggerClientReady (C:\Users
      bb78\Desktop\falconcad_bot
      ode_modules\discord.js\src\client\websocket\WebSocketManager.js:431:17)
      at WebSocketManager.checkShardsReady (C:\Users
      bb78\Desktop\falconcad_bot
      ode_modules\discord.js\src\client\websocket\WebSocketManager.js:415:10)
      at WebSocketShard. (C:\Users
      bb78\Desktop\falconcad_bot
      ode_modules\discord.js\src\client\websocket\WebSocketManager.js:197:14)
      at WebSocketShard.emit (events.js:315:20)
      at WebSocketShard.checkReady (C:\Users
      bb78\Desktop\falconcad_bot
      ode_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
      at WebSocketShard.onPacket (C:\Users
      bb78\Desktop\falconcad_bot
      ode_modules\discord.js\src\client\websocket\WebSocketShard.js:447:16)
      at WebSocketShard.onMessage (C:\Users
      bb78\Desktop\falconcad_bot
      ode_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
      at WebSocket.onMessage (C:\Users
      bb78\Desktop\falconcad_bot
      ode_modules\ws\lib\event-target.js:132:16)
      (Use `node --trace-warnings ...` to show where the warning was created)
      (node:9628) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or
      by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
      (node:9628) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

    • @flooby_
      @flooby_ 4 ปีที่แล้ว

      I even followed that one comment that said put "cache" in front of "forEach"
      edit: I solved my problem, forgot it doesn't like to do it if you don't save

  • @damianfreeman7129
    @damianfreeman7129 4 ปีที่แล้ว

    server region is for guild voice not text

  • @bizelzuze6659
    @bizelzuze6659 4 ปีที่แล้ว

    The terminal does not recognize npm or node.

    • @metawat
      @metawat 4 ปีที่แล้ว

      try run it on the cmd its works for me

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

    When I did, "npm install discord.js" is came back with
    "Invalid version: "npm install discord.js"

    • @pigeonr5306
      @pigeonr5306 5 ปีที่แล้ว

      npm install discord.js - - save

  • @LucasPro-iw8uf
    @LucasPro-iw8uf 5 ปีที่แล้ว

    I can't see 1:cmd in the Terminal, I see only 1: powershell it is problem?

    • @gibezz3933
      @gibezz3933 5 ปีที่แล้ว

      Click "Select Default Shell", then choose Command Prompt.

    • @slybandit8117
      @slybandit8117 4 ปีที่แล้ว

      no either is fine. Powershell is the Win10 upgraded terminal, to get to your computer's terminal click the Windows button and type CMD. Powershell, right-click the windows symbol(taskbar)

  • @11duckss
    @11duckss 4 ปีที่แล้ว +1

    Didn’t work for me idk why

  • @robertjackson1546
    @robertjackson1546 4 ปีที่แล้ว

    This really works

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

    The irony xD
    Bot gets invited: Klicks "i am not a robot"

  • @sillylilfella2010
    @sillylilfella2010 4 ปีที่แล้ว

    npm dosent work on mine

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

    10:28

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

    its telling me split isnt a command here is my code: let commandSplit = fullCommand.split("")

    • @flosset9640
      @flosset9640 5 ปีที่แล้ว

      never mind fixed it

  • @sammysammysammy100silly
    @sammysammysammy100silly 5 ปีที่แล้ว

    I DONT UNDERSTAND ANYTHING
    4:10 WHAT DO YOU MEAN? D;

  • @calebfuller3394
    @calebfuller3394 4 ปีที่แล้ว

    So uh idk if this is still valid but great vid I don’t have a computer tho so yea

  • @ЮрийЛаврухин-к2г
    @ЮрийЛаврухин-к2г 6 ปีที่แล้ว

    Amazing.

  • @kizarisan2366
    @kizarisan2366 3 ปีที่แล้ว

    i got an errors here 5:55

  • @pug6871
    @pug6871 5 ปีที่แล้ว

    Can someone tell me what the best programming language is for making discord bots? I cant find any info on it :/

    • @greysocks
      @greysocks 5 ปีที่แล้ว

      Js

    • @greysocks
      @greysocks 5 ปีที่แล้ว

      You can make web interface (or dashboard) easily with js

  • @Thomas-bu7lv
    @Thomas-bu7lv 5 ปีที่แล้ว

    When I try to do npm install discord.js. It won't let me.

    • @francescoscarselli_mix
      @francescoscarselli_mix 5 ปีที่แล้ว

      you neeed to restart your computer after you installed node.js

    • @Thomas-bu7lv
      @Thomas-bu7lv 5 ปีที่แล้ว

      @@francescoscarselli_mix I did.

    • @francescoscarselli_mix
      @francescoscarselli_mix 5 ปีที่แล้ว

      Unidentified Shapes Try npm install Discord.js -save

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

      Try in terminal "sudo apt-get install npm -y" and it should work perfectly.
      In some cases npm is not installed by default, don't know the cause of this, so manually installing it usually fixes the issue...

    • @Thomas-bu7lv
      @Thomas-bu7lv 5 ปีที่แล้ว

      @@bafana_mhlamvu Alright, I'll try.

  • @callumu
    @callumu 4 ปีที่แล้ว

    when i make the forEach loophole and i try and run in in the termanal it comes up with a really long message starting with client.guilds.forEach is not a functio pls help im loosing my mind i am 99.999% i copied the code correctly

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

      client.guilds.cache.forEach((guild) try this...

  • @crystalslayer356rblx7
    @crystalslayer356rblx7 3 ปีที่แล้ว

    It hasn’t worked for me I can’t get it online.

    • @seal9039
      @seal9039 3 ปีที่แล้ว

      Make sure you type the code correctly and then save the file and it's supposed to work

  • @ajeetpandey6461
    @ajeetpandey6461 4 ปีที่แล้ว

    error npm not found
    pls help

    • @jackiea4621
      @jackiea4621 4 ปีที่แล้ว

      You can run npm commands directly in terminal (ctrl + `). Make sure that terminal has cmd.exe as the shell selected.
      You can default cmd.exe as your shell by following these steps.
      ctrl+Shift+p
      Type > Select Default Shell + Enter
      Select > Command Prompt ...cmd.exe
      Restart VS Code.

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

    When people are new to programming and/or discord.js and get an error...
    *Because the tutorial is outdated!*

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

      is it?

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

      massive jeffery yep
      Edit: Some works, some doesn’t

    • @danielvidal7163
      @danielvidal7163 4 ปีที่แล้ว

      @@YukiGersaniba Everything in the tutorial works for me.

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

    MODULE_NOT_FOUND

  • @bala-st9cj
    @bala-st9cj 5 ปีที่แล้ว

    Does anyone know price of discord?

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

      It's free...

    • @bala-st9cj
      @bala-st9cj 4 ปีที่แล้ว

      @@amiriki ✌

  • @ayoabimbola777
    @ayoabimbola777 4 ปีที่แล้ว

    Thanks for the video... Links aren't working please