Code Your Own Discord Bot - Basic Command Handler (2021)

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024
  • Code your own Discord bot! Coding a basic command handler can be very easy when you try discord js. This video shows you how to create custom commands for your own discord bot using this basic method. I will be uploading the advance method tomorrow morning! Coding your own discord bot is very easy!
    🡺 Discord Server: / discord
    🡺 SECOND CHANNEL: / alesh
    🡺 Twitch Channel: / itzalesh
    🡺 Twitter: / itzalesh
    NodeJS: nodejs.org/en/
    Visual Studio Code: code.visualstu...
    Discord Developer Portal: discordapp.com...
    Permissions Calculator: discordapi.com...

Комментарии • 1,9 тыс.

  • @CodeLyon
    @CodeLyon  3 года назад +103

    Come join my discord server -> discord.gg/lyon

  • @Akatsuki-21
    @Akatsuki-21 4 года назад +980

    me when I got my bot to say hi:
    *p r o g r a m m e r*

    • @boombasticx
      @boombasticx 3 года назад +16

      Same Bro............SAME

    • @dqrks
      @dqrks 3 года назад +1

      LOL XD

    • @tanzeelkhan8046
      @tanzeelkhan8046 3 года назад

      XD

    • @unknown_1213
      @unknown_1213 3 года назад +6

      My bot goes offline when I close command prompt and visual studio code
      How can I keep it online 24/7

    • @xyvbzz1856
      @xyvbzz1856 3 года назад +2

      @@unknown_1213 ruclips.net/video/8qIsRzV0Hpg/видео.html

  • @brainzistasty4112
    @brainzistasty4112 4 года назад +1063

    i literally cried when my little bot guy said "pong!"

    • @asifulakib965
      @asifulakib965 4 года назад +53

      I hope I can feel it to . But my but doesn't start

    • @kyron7850
      @kyron7850 4 года назад +3

      asiful akib have you got the correct token?

    • @kyron7850
      @kyron7850 4 года назад +5

      asiful akib try changing the token

    • @vonckjenl3633
      @vonckjenl3633 4 года назад +27

      @@kyron7850 my bot has the right token. it comes online when i do node . but still it doesnt respond
      i have the code exceacly the same

    • @asifulakib965
      @asifulakib965 4 года назад +4

      @@kyron7850 I ve change it once . I think I'll try again .

  • @_Vexzz
    @_Vexzz 4 года назад +245

    you know he is a coder if he is Coding at 3 AM lmao

  • @TotallyNotLuna741
    @TotallyNotLuna741 2 года назад +8

    This is the only person that makes a Coding video actually enjoyable

  • @theinfinitevoid7855
    @theinfinitevoid7855 4 года назад +570

    Me: gets an error
    Also me: spends 3 hours to try to find out my error
    Also Also me: cant spell message

    • @ANSHPRATAPSINGH11
      @ANSHPRATAPSINGH11 4 года назад +3

      Me too

    • @Akatsuki-21
      @Akatsuki-21 4 года назад +3

      bruh same

    • @tbking441
      @tbking441 3 года назад +3

      EXACTLY THE SAME
      I SPELT MUSSAGE

    • @kikkaaaaa
      @kikkaaaaa 3 года назад +3

      hey ı cant get my bot online ' node . ' not working can u help me

    • @siddxx1612
      @siddxx1612 3 года назад +1

      same
      xd

  • @jade0709
    @jade0709 3 года назад +15

    for the people who don't know how to open command prompt in visual studio code:
    press Ctrl and ` at the same time. ( the ` key is the key on the top left corner just under Esc)

  • @breezehd540
    @breezehd540 4 года назад +71

    I’m reading all these comments, and I’ve been having the same problems, I’m new to coding with Discord Bot. It’s not always you’ve coding wrong, save your work shut it down, shut down discord, re open them, put your Bot online, and try that. That’s what I’ve literally been doing. Hope this helps!

    • @yaseenlmao2181
      @yaseenlmao2181 4 года назад +4

      YOU’RE A LIFE SAVER

    • @shock3493
      @shock3493 4 года назад +2

      DUDE TY
      U HELPED SO MUCH

    • @revonwii7700
      @revonwii7700 4 года назад

      It didn’t help me or just said
      Line 2
      Char 1
      Error syntax error
      Code 800A03EA
      Source Microsoft jscript compilation error

    • @wxsen5127
      @wxsen5127 4 года назад

      Tysm! take my like

    • @bigshit
      @bigshit 4 года назад

      do i have to turn my bot offline to update the data, or can i just do node . and have it update automatically

  • @alanli8991
    @alanli8991 4 года назад +128

    pc: error!
    me: spends like an hour adjusting everything
    me: inserts ; symbol at line 5
    pc: everything works

    • @jasminelynx2210
      @jasminelynx2210 4 года назад +6

      That's javascript for you

    • @bruhhh-__-
      @bruhhh-__- 3 года назад

      Pretty irritating

    • @abelvis_ua
      @abelvis_ua 3 года назад +1

      I also forgot that.

    • @firco7
      @firco7 3 года назад

      one of apperently multiple errors thx mate xD

    • @System-mr3he
      @System-mr3he 3 года назад

      LOL SAME TO ME

  • @idaolsson3749
    @idaolsson3749 4 года назад +14

    For everyone whose bots are online but the commands themselves aren't working (check for typos first ofc), aka the bot seems to just be ignoring them, check the bot permissions, they should have the permission to read/send messages, history etc. Experiment with different permissions, this is what made it work for me.

    • @joeyderosas7009
      @joeyderosas7009 2 года назад +2

      but i give it the admin permision

    • @Willow_and_Sage
      @Willow_and_Sage 2 года назад

      @@joeyderosas7009 Same.

    • @r4xlm
      @r4xlm Год назад +1

      can you send the script you did?

  • @Asumji
    @Asumji 4 года назад +42

    Didn't look in your tutorials for a long time watched you when you had like 200 - 400 subs and you only had like 4 videos for bot tutorials I just wanted to thank you again for teaching me the basics meanwhile now I advanced to making bot commissions and bots from simple moderation bot to advanced highly customizable MEE6 lvl bot. I am rly happy you gained 12 k subs now keep up the great work ^^. and I like that you swapped to const command now and don't use switch(args[0]) anymore because that was so broken and had so many bugs but yeah I later learned to fix it too. Hope you reach 100k soon

    • @wonhipolicee6695
      @wonhipolicee6695 2 года назад +1

      This made me smile.

    • @gamingwitharoma9267
      @gamingwitharoma9267 Год назад

      How do u put your bot offline?

    • @Asumji
      @Asumji Год назад

      @@gamingwitharoma9267 it'll go offline after a minute or 2

    • @gamingwitharoma9267
      @gamingwitharoma9267 Год назад

      @@Asumji btw it says it has a problem with a const idk which one

  • @wagasani4199
    @wagasani4199 3 года назад +96

    *Checks description for pastebin*
    *Screams internally*

  • @brookeelizabeth811
    @brookeelizabeth811 4 года назад +55

    I lowkey started crying when my bot responded
    Im so proud of myself

    • @arinmcgilvray9945
      @arinmcgilvray9945 3 года назад

      same

    • @michaela51
      @michaela51 3 года назад +1

      good for you my bot wont even stay on now

    • @JustN3el
      @JustN3el 3 года назад

      Same bro lol now i got like 150working comms on the bot

    • @blitz19872
      @blitz19872 3 года назад

      Me: codes a whole 2d game, what ya' dog'doin

  • @weslax8346
    @weslax8346 2 года назад +2

    This guy is legendary. He is recording this video at 3 AM

  • @iisushristos4380
    @iisushristos4380 4 года назад +10

    yo this man is a total genius, thanks man!

  • @Eternalll
    @Eternalll 3 года назад +66

    Everyone else:
    I cried when my bot said pong!
    Me:
    Forgets the second m in command for 30 minutes

  • @SUVET
    @SUVET 4 года назад +205

    i have just started making my own discord bot using the 2019 tutorials and now your doing newer tutorials that are more updated my luck lol
    edit: no way i go thrugh my gmail see someone replied and i got 50 likes most likes ive ever got on a comment

    • @Kiwinetic
      @Kiwinetic 4 года назад +3

      lol same

    • @ehclipse8764
      @ehclipse8764 4 года назад +2

      same, finally got it to run and now I look at this and I'm like bruh

    • @stub2233
      @stub2233 4 года назад

      its really like the same thing though

    • @jeffrey5163
      @jeffrey5163 4 года назад +1

      same here

    • @kuzehype9408
      @kuzehype9408 4 года назад

      HAHA same

  • @crosstr15
    @crosstr15 3 года назад +3

    I already did some of this, but........... this guy is awesome! I looked at his channel and is full of these things, which motivates me. I always wanted to have my own bot.

  • @WillTDA
    @WillTDA 4 года назад +76

    Really good tutorial 😁 I’d like to see a tutorial for reaction roles, so the bot can give the role that the server owner assigned to a reaction icon, for example:
    1. The bot asks what message to assign a reaction to (by message I.D.)
    2. The bot then asks for the emoji to put on the reaction (by emoji I.D.)
    3. Finally the bot asks which role to assign to the reaction
    (Sorry if that didn’t make sense, I can’t explain things too well 😂)

    • @epixerty
      @epixerty 4 года назад +11

      @@CanaryLivesOn dude he wants to make the command not invite a bot

    • @hotsoda46
      @hotsoda46 Год назад

      @@epixerty ?????

    • @lucasli3273
      @lucasli3273 Год назад

      You'll never learn to code if you only watch tutorials

    • @hotsoda46
      @hotsoda46 Год назад

      @@lucasli3273 not like I've been coding since 2019 and know C#, JavaScript, and Lua, but I guess it's none of your business.

    • @hotsoda46
      @hotsoda46 Год назад

      @@lucasli3273 and also who said i only watched tutorials? i was only questioning what he meant because he was speaking gibberish

  • @ID_Station
    @ID_Station 3 года назад +8

    It would be cool if you included that this was part 2. It was very difficult finding this next part. But other than that, I feel so smart making it this far lol

  • @Area51ofTech
    @Area51ofTech 3 года назад +5

    You were so helpful step by step and made it so easy and made it in parts so you can go in depth, I dropped a sub to your channel

  • @ScratchTuto
    @ScratchTuto 3 года назад +15

    Usually, I would just copy and paste, but I really want to learn that.

  • @bean_s_
    @bean_s_ 4 года назад +127

    the discord disconnect ping at 6:02 sent me on a search for who the heck I was on call with

    • @insanetadka1651
      @insanetadka1651 4 года назад +1

      me too XD

    • @aru-YT
      @aru-YT 4 года назад +1

      SAMEE i got scared for a sec

    • @barbromp4
      @barbromp4 4 года назад

      lol me to

    • @yooforza9481
      @yooforza9481 3 года назад +1

      i was singing and when i heard that I just shock,I have 500 people on server in my ming i just said bye guys deleting server rn lol

    • @razvanbrehoi
      @razvanbrehoi 3 года назад

      6:03 i heard

  • @baconpancakes5353
    @baconpancakes5353 3 года назад +14

    I spent a week trying to figure out why tf he wasnt saying pong back and literally cried when I realized this whole time all I was missing was a ; at the end 😭😭

  • @UKRUX
    @UKRUX 3 года назад +72

    how many of u thought while watching the video at 6:06 that if u were disconnected to a discord voice chat xD

  • @igeclan7824
    @igeclan7824 4 года назад

    Everyone if you code it and then go to the CMD/command terminal and you type CD {your bot file name} and then type NODE . and it won’t show any errors or won’t say your bot is online I had that issue what worked for me was I refreshed the BOT TOKEN and pasted the new one in the bot login code and when I went to CMD to launch it it said my my bot was online and it was and codelyon big thanks to you I have now watched several of you discord bot tutorial videos!

  • @mr_sebo4037
    @mr_sebo4037 4 года назад +8

    New video! Yeeeeeeeeeeeet
    You are so helpful! Thanks so much! :D

  • @Voxelstice
    @Voxelstice 4 года назад +1

    Woah... I have been using the old discord.js code a while. Thank you for making this video!

  • @AlexEEZ
    @AlexEEZ 4 года назад +13

    I just wanna tell you guys, that I did have problems setting it up at first. Nothing works out immediately once you follow a tutorial, you have to experiment a bit, try out a new way to do the thing you're trying to do. Like how I first followed the 2019 tutorial then the 2020 one. And I had some trouble with getting the discord version show up at first, I had to manually check it and fill it in. Aaand how when I try to run it in the program it doesn't work, but in cmd it does! I had to think of ways to get through these problems first. And to my surprise, it worked perfectly after that! I also found out how to make the bot say the command user's username and tag.
    Don't be afraid to experiment, always experiment. :D

    • @epiccturtle
      @epiccturtle 3 года назад +1

      yes but everything i try doesnt do anything

    • @AlexEEZ
      @AlexEEZ 3 года назад +1

      @@epiccturtle well think about it a bit
      what could correlate to/resolve this issue I'm having
      and try to do it a different way
      try new things that the tutorial doesn't tell you about maybe
      of course, it not working at all is also a possible case, if so, I can't really help you with it..

  • @Ais4Drew
    @Ais4Drew 4 года назад +28

    3:14 long time no comment - but the symbol you’re referencing is called the “pipe” operator 😎

  • @kei3300
    @kei3300 2 года назад +10

    'message' is now deprecated and you need to use 'messageCreate' from now on in 2022! so adjust this in the code from the video.
    EDIT: Also make sure that you have your intents set correctly because now you need to explicitly define your intents for 2022 id look up a more recent tutorial

  • @lucvdk1155
    @lucvdk1155 2 года назад

    Thanks for the tutorial CodeLyon. I was having difficulties making it work until i realised i put a . where there was not meant to be one haha but i keep learning from your videos thank you so much.

  • @AlexEEZ
    @AlexEEZ 4 года назад +14

    I MADE MY BOT SAY :FLUSHED:
    THANK YOU SO VERY MUCH FOR EXISTING!

    • @FritzenA
      @FritzenA 4 года назад

      lmao

    • @EfeIrmakk
      @EfeIrmakk 4 года назад

      YO @AlexEEZ

    • @AlexEEZ
      @AlexEEZ 4 года назад +1

      @@EfeIrmakk poggers

  • @nnoname70.deleted
    @nnoname70.deleted 9 месяцев назад

    bro ily its the best channel for code education, its so helpfull

  • @TurdalTube
    @TurdalTube 3 года назад +12

    20 mins later bot corrupts and takes over the universe
    the world: GET EMM!!!!!!

  • @bluevidztv8844
    @bluevidztv8844 3 года назад +2

    I have a problem I have done evrything right and typed the code again checked it 5-10 times and the -ping doesnt work im tryng to fix it for an hour and I cant do it can someone please help.

  • @gigachad8810
    @gigachad8810 3 года назад +6

    thanks for including the pastebin i appreciate it ..........

  • @Furscorns
    @Furscorns 4 года назад

    i set my prefix to "fur" but when i test it out its not responding with pong at all, i checked if my code was the same as yours but it still wont work and yes i did try to save my code

  • @ayoubabbaia1092
    @ayoubabbaia1092 4 года назад +14

    when you are watching 1.11 v videos but the code doesn't work and you finally realize codeLyon is back for the new version :D

    • @potatoman4548
      @potatoman4548 4 года назад

      I just update the gateway intents, no big deal.

    • @vemoryu1198
      @vemoryu1198 4 года назад

      How?

    • @potatoman4548
      @potatoman4548 4 года назад

      @@vemoryu1198 discordjs.guide/additional-info/changes-in-v12.html

    • @ayoubabbaia1092
      @ayoubabbaia1092 4 года назад

      @@vemoryu1198 there is a new serie for v12
      the old one fir v11 and the code doesnt work anymore

    • @vemoryu1198
      @vemoryu1198 4 года назад +1

      Thanks a lot dude, You saved me from going on wrong direction haha

  • @Arzene22
    @Arzene22 3 года назад +1

    Thank you so much for your tutorials. It helps me a bunch as a beginner!

  • @hoveringcube5339
    @hoveringcube5339 4 года назад +7

    Codelyon : u can do it like this or like this
    Me : imma do whut u do aight!

  • @TheWhiteMocho
    @TheWhiteMocho Год назад +2

    Hi, good video. my bot is working but the commands arent and it doesnt show any error. how can i fix it?

  • @bradypoggioli4202
    @bradypoggioli4202 4 года назад +3

    I felt like a master hacker when my bot said pong lol

  • @Ayoubiii
    @Ayoubiii 3 года назад +2

    why does it not say pong and i did everything right ?

  • @hexednex
    @hexednex 2 года назад +3

    In case anyone was having trouble with adding a second command, and gets the error Unexpected token ')' make sure you added the ending bracket '}' after the second line

  • @suryavkasthuri8a590
    @suryavkasthuri8a590 3 года назад +1

    Me when I type -ping : no response
    also me watching this video 100 times : finds out i was missing the "!" in message

  • @miroslavzajicek710
    @miroslavzajicek710 3 года назад +2

    my code looking normal and I can make it online too but when I write -ping nothing happens can you help me?

  • @kesjarandor5821
    @kesjarandor5821 3 года назад +5

    Mine doesn't work, I checked a million times and I dont see any mistakes in the code, its the same as yous but it doesnt work. I can get it to tell the lig that its online but it wont respond to my ping message. Any advice?

    • @cgw_yt
      @cgw_yt 3 года назад +1

      yeah same lol this tutorial was working literally 2 weeks ago lol(I watched all his videos and make a giant bot!)and it stopped working so it might be something on Discord's side but I'll keep you updated

    • @rascal5731
      @rascal5731 3 года назад

      @@cgw_yt did u find out?

    • @cgw_yt
      @cgw_yt 3 года назад

      @@rascal5731 nah sadly not, I've been researching mad hard too :(

  • @WolfieMoonDev
    @WolfieMoonDev 2 года назад

    thank you for the tutorials, they are really helpful and im having fun with the bot

  • @realcraser3559
    @realcraser3559 4 года назад +5

    XD "mason gay makeout club" sounds very mature

  • @cjgreen4331
    @cjgreen4331 4 года назад

    Bro, this video and its series are so helpful

  • @mohammad4388
    @mohammad4388 4 года назад +15

    The bot isn’t responding after when ran the command.
    Do you mind helping me out??? I think that the 2019 method works a little better. @CodeLyon

    • @kekboom7969
      @kekboom7969 4 года назад +1

      yeah true same

    • @aweirduserbreh
      @aweirduserbreh 4 года назад

      same

    • @darren9721
      @darren9721 4 года назад +1

      i got it but i went to the advanced and something went wrong so i started from scratch

    • @sinenomine2067
      @sinenomine2067 4 года назад +2

      For me its a problem with the 'const command' not being used or something, I don't know why it's doing that ;-;

    • @Gamer-cm9ze
      @Gamer-cm9ze 4 года назад

      remove /+/ and add Empty and save it and run again

  • @tog8964
    @tog8964 4 года назад

    You automatically earned my respect with that Desktop home screen. ✊

  • @rafaelbustillo1308
    @rafaelbustillo1308 3 года назад +3

    How can i do so the bot stays online always because when I close my command prompt it goes offline

  • @matthewjackson1422
    @matthewjackson1422 3 года назад +2

    I having a problem where my commands don’t want to execute, everything has been done correctly and my bot goes online etc. it just don’t execute the command when I do my prefix, anyone having the same problem or able to help me?

    • @halal.pikmin
      @halal.pikmin 3 года назад

      ok so if this cant help u idk but it helped me so it says (pong!);
      } after the } scine put a ; symbol without anny space bar and open terminal in vs code and tipe node . this really helped hope i could help u :)

  • @andrija6805
    @andrija6805 3 года назад +5

    When i say Ping why do i dont get reply i did every step any help?

    • @delta6402
      @delta6402 3 года назад

      same. in my terminal it gives me errors

  • @yupfortnitex
    @yupfortnitex 4 года назад +1

    my bot is online But when i do !ping (! is my prefix) it doesnt work PLEASE HELP ME

  • @c0dered539
    @c0dered539 4 года назад +11

    Please do a tutorial on reaction roles because it is always down

  • @colttttttt
    @colttttttt 3 года назад +1

    thanks man! been having alot of troble lately, (because im just now getting into js)

  • @carter8292
    @carter8292 4 года назад +189

    You never left the code in the description like you said you would

    • @7fiyt
      @7fiyt 4 года назад +3

      yeah noticed that too lol

    • @Retrosen
      @Retrosen 4 года назад +17

      Bruh just type it

    • @vonckjenl3633
      @vonckjenl3633 4 года назад +69

      here this is the code from mine. it is the excest as in the video.
      const Discord = require('discord.js');
      const client = new Discord.Client();
      const prefix = '-';
      client.once('ready', () => {
      console.log('your bot name is online!');
      });
      client.on('message', message =>{
      if(!message.content.startsWith(prefix) || message.author.bot) return;
      const args = message.content.slice(prefix.length).split(/ +/);
      const command = args.shift().toLowerCase();
      if(command === 'ping'){
      message.channel.send('pong!');
      }
      });
      client.login('your discord bot token');

    • @jackp548
      @jackp548 4 года назад +10

      @@vonckjenl3633 what a lad

    • @turtleblade_exe9100
      @turtleblade_exe9100 4 года назад

      yeah

  • @warrior2364
    @warrior2364 3 года назад +1

    me when i create a command to my bot:
    h a c k e r m a n

  • @flurl6318
    @flurl6318 3 года назад +14

    I tried to make a command where you type !good bot and then it reacts. To do that I tried using
    else if(command == 'good bot')
    for it, but it appears the bot just doesn't recognize this. It doesnt give an error message in visual studio either. If i use
    else if(command == 'goodbot')
    it does react as it should.
    Is there an easy way to do this or not. I tried to google it, but this is my first experience with javascript, so I don't really get what they say.
    Already thanks if someone has an answer!
    edit: I solved it by adding
    const args2 = message.content.slice(prefix.length).split();
    const command2 = args2.shift().toLowerCase();
    and using
    else if(command2 == 'good bot')
    instead. It boils down to just using something that's not a space as argument in split( )

    • @Lucs-zb5gy
      @Lucs-zb5gy 3 года назад +1

      tysm

    • @thomas_hatt_died
      @thomas_hatt_died 2 года назад +1

      Thank you, spent way too long trying to figure out what was wrong with my code

  • @aviatorsmac
    @aviatorsmac Месяц назад +1

    i can't get is to say pong. ive tried everything that the comment section suggested, compared the code, but still no progress. been struggling on this for 3 days :( [im da beginner]

  • @pq3o
    @pq3o 4 года назад +4

    Are you gonna do the music bot tutorial in this series too? Please do...
    Thank you.

  • @jordanangelov2215
    @jordanangelov2215 3 года назад

    thank you so much for making those videos. This is helping so much!

  • @gamechilliessheart9588
    @gamechilliessheart9588 3 года назад +7

    I couldn't find the code in the description. I think you may have forgot to add it.

    • @Devtong
      @Devtong 3 года назад

      this isnt I give u source code! its you learn/do it yourself dont be a lazy bastard

    • @wuzz5703
      @wuzz5703 3 года назад

      @@Devtong hmm, yeah but im having a weird issue, while i typed everything right..just wanted to see what i did wrong.

    • @pyxalated
      @pyxalated 3 года назад

      @@Devtong same

  • @Blaster-the-holobot
    @Blaster-the-holobot 2 года назад +2

    Idk why, i dont get any error message but my bot doesn't respond to my command. Does anyone know why?

  • @finn-ss8ps
    @finn-ss8ps 4 года назад +11

    how do u make it so u can have spaces in the things ur saying

    • @biscuit6076
      @biscuit6076 3 года назад

      im trying to figure that out too hopefully you figured it out

    • @finn-ss8ps
      @finn-ss8ps 3 года назад

      @@biscuit6076 underscores for spaces

    • @cope5223
      @cope5223 3 года назад

      press the tab button in your keyboard
      that should work

    • @chillisdepressed
      @chillisdepressed 3 года назад

      @@cope5223 doesnt work

    • @cope5223
      @cope5223 3 года назад

      @@chillisdepressed really? I did it on my computer and it worked

  • @akarachaiinthanil4841
    @akarachaiinthanil4841 3 года назад

    It is very important to keep spaces. This is the guideline for error code.
    Finally, I done.

  • @kaiserr2549
    @kaiserr2549 4 года назад +4

    i was going with the tutorial, and when i just wanna launch bot there was a error:
    "TypeError: args.shift is not a function"
    How to repair this?

    • @babysharklive8905
      @babysharklive8905 4 года назад

      its args.shift() , make sure u wrote that correctly
      pastebin.com/8nRQjjJL here a pastebin file made by me. Refer to this if u face any errors

  • @JimTim24
    @JimTim24 3 года назад +1

    There a way to have the bot just read messages without a prefix?

  • @Flixer145
    @Flixer145 4 года назад +3

    yeah what if I want to make a same command and the bot send randomize line each being send?
    btw great video, easy to follow

  • @adibhassan1378
    @adibhassan1378 4 года назад +1

    so if i dont want any prefix do i leave blank in the place where we're supposed to put prefix?

  • @dotroy7033
    @dotroy7033 4 года назад +10

    5:27 saving my time

  • @waffledkai
    @waffledkai Год назад

    Bro I felt so proud when I created an actual bot that works, it felt like it was my child LMAOOO

  • @krunchie1770
    @krunchie1770 4 года назад +5

    I have an issue that I haven't seen anyone tackle, if i use spaces for the commands i want to say/bot to say then they wont work, can anyone help me please? I'm desperate at this point

    • @AbstractBigCat
      @AbstractBigCat 4 года назад +1

      A litte late but I used visualizer's aid and it worked! Instead of the line provided, I used:
      if (command === 'ping'){
      const newLocal = 'Pong Pong Pong Pong';
      message.channel.send(newLocal);

  • @SipOnTris
    @SipOnTris 3 года назад +1

    can sum1 help i did everything and spent 1 hour trying to see if i made a mistake and there is absolutely nothing diffrent and it still isnt responding when i do (prefix)ping

  • @leachosu
    @leachosu 4 года назад +10

    So, I'm trying to make a bot that sends messages at specific times, how can I do that?

    • @steveschaninger2535
      @steveschaninger2535 4 года назад

      you need to grab date time from console and post message if the time constant you want your bot wants to post at matches the current date time

    • @leachosu
      @leachosu 4 года назад

      @@steveschaninger2535 and how can i grab date time from console?

    • @steveschaninger2535
      @steveschaninger2535 4 года назад

      @@leachosu in JS its Date.now();
      Make sure u assign a variable to it

    • @steveschaninger2535
      @steveschaninger2535 4 года назад

      @@leachosu check ur discussion page on your channel. i sent a reply

  • @sargent1440
    @sargent1440 3 года назад +1

    dose this work on replit ??
    BTW Love ur vids !!

  • @madebyoffworld8208
    @madebyoffworld8208 4 года назад +4

    my bot won't respond with pong! and when I run the node . it says: Segmentation fault: 11 Can someone help me

  • @LucStarGamesLPP
    @LucStarGamesLPP 3 года назад +1

    I think it isn't working, I did all the same but it doesn't reply... Please help

  • @tottozs
    @tottozs 4 года назад +6

    Can you make a music bot 2020 tutorial please? I started code from 2019 video bot not working so please make a new tutorial. Thank you!

  • @sheno8990
    @sheno8990 3 года назад +2

    when i say !ping it dont say back pong! hope you answer me

  • @2KBlockBlind
    @2KBlockBlind 4 года назад +6

    "mason gay makeout club"
    my name is mason and I am here to ask "why tf are u in a vc called that lmfao"

  • @mulc2849
    @mulc2849 4 года назад +2

    i can't get my bot to say pong. Any solution?

    • @komozoyo5849
      @komozoyo5849 3 года назад

      Same my bot is also not responding

  • @xopgaming2140
    @xopgaming2140 4 года назад +3

    If I typed a command "-ping" for an example it would respond back with "pong!' around 2-5 times. Help.

    • @lemonaide.
      @lemonaide. 4 года назад

      sm here ;-;

    • @doppomine202
      @doppomine202 4 года назад +1

      Where it says powershell try deleting all of them and retrying node again. I think having too many of those build up causes that? I just delete them back to 1 and it always solved it so hoping that helps!

    • @kyron7850
      @kyron7850 4 года назад +1

      Shibu SS Yea, having to many powershells open does cause it, and for a longer fix restart visual, I did it 3 months ago and I’ve not have any problems since then

    • @fliqs6156
      @fliqs6156 4 года назад

      i got you... reset your token and replace the old with the new token

    • @sukozui
      @sukozui 4 года назад

      It's because you have a lot of terminals open.

  • @nikonikostudios9461
    @nikonikostudios9461 4 года назад

    Since nobody has made the bot ive been waiting for someone to make, ill just make it myself :)

  • @aeisu2872
    @aeisu2872 4 года назад +5

    1:18 dont mind me just marking where i left off for tomorrow me

  • @maidakamel157
    @maidakamel157 4 года назад +1

    Help me I did the same thing as u but when I do ?ping the not doesn't respond

  • @zyfalol1539
    @zyfalol1539 3 года назад +3

    my bot is not respoding!!!!!!!!!

  • @Rustydusty
    @Rustydusty 4 года назад

    These tutorials are great I subbed

  • @UserUsing2
    @UserUsing2 3 года назад +14

    where is the pastebin lol

    • @badboys-zu5gw
      @badboys-zu5gw 3 года назад

      lol

    • @irissikigaii
      @irissikigaii 3 года назад

      discordjs.guide tell me if its wrong link bc i dont remeber the link lol

  • @BlueStinger475
    @BlueStinger475 3 года назад

    "My bot says pong"
    Me: YAAAA- wait, these tutorials never usually work, but this one did

  • @a1mhndi
    @a1mhndi 4 года назад +5

    How do I change the pong command so that when it replys it says
    🏓 | Pong! That took 198ms
    or however many ms it took.

    • @SO_Snake
      @SO_Snake 4 года назад +3

      Change
      ('pong')
      to
      ('🏓 | Pong!')
      it should look like this:
      if(command === 'ping')
      message.channel.send('🏓 | Pong!')

  • @fazstudios
    @fazstudios 3 года назад +2

    so, the commands aren't working. whenever i try to do one the console says, "(node:3868) DeprecationWarning: The message event is deprecated. Use messageCreate instead
    (Use `node --trace-deprecation ...` to show where the warning was created)" i tried doing the command it shows, but it just showed me the file location.

    • @abigailkaye9609
      @abigailkaye9609 3 года назад

      im havin the same problem too

    • @hanly8610
      @hanly8610 3 года назад +1

      @@abigailkaye9609 replace the message line with this: client.on('messageCreate', message =>{
      they just updated node or smth thats why message is changed to messageCreate

    • @BlackDoorYouT
      @BlackDoorYouT 3 года назад

      @@hanly8610 thank youuuuu

  • @dkminova
    @dkminova 4 года назад +5

    I can't see where your typing

  • @slowferot
    @slowferot 4 года назад +4

    The bot isn't responding to my command. @CodeLyon, pls help me.

    • @goldendragon4891
      @goldendragon4891 4 года назад

      same HELP

    • @ritvikdalal156
      @ritvikdalal156 4 года назад

      i think you guys probably made mistake while typing the codes or didn't run the codes the way they were supported to go.

  • @lucaraggio4614
    @lucaraggio4614 4 года назад +1

    A maybe stupid question: Instead of a chain of Elseif, can I use Switch/Case?

  • @mrslacci4358
    @mrslacci4358 4 года назад +3

    ReferenceError: client is not defined guys, can you help me?

    • @sadl040
      @sadl040 4 года назад +1

      conseguiu resolver?

    • @taifletcher9608
      @taifletcher9608 4 года назад

      Try replace everything with this.
      const Discord = require('discord.js');
      const client = new Discord.Client();
      const prefix = '-'
      client.on("ready", () => {
      console.log('Your bot is now online')
      })

  • @ducky2464
    @ducky2464 3 года назад +2

    If anybody is having trouble getting the command to work make sure on
    if(command === '-ping'){
    message.channel.send('pong');
    }
    });
    That you add the prefix inside the quotation or else it wont work (also if thats not working make sure you've added semi colons in all the right places)

    • @stromka5127
      @stromka5127 3 года назад

      Thank you!!!!

    • @ducky2464
      @ducky2464 3 года назад

      @@stromka5127 no problem happy i could help