This video took me probably a total of like 20 hours to create, so it would be greatly appreciated if you could leave a like if you found it helpful! Thank you for watching :)
@Niconiconii hey niconiconii will you make a video on how to keep a bot online 24/7 pls as when I close the VS CODE (where I have written the code) the bot automatically gets offline...
What a great and comprehensive tutorial! I wanted to ask about displaying the exact elapsed time of the currently playing song, since I wanted to display that in the info page as well. Regardless, this video tackled the essentials that I was mostly interested with, and I'm glad to say that this is very well done!
Great video, really helped get me started on my own bot. I would be super interested in a video going through some of the extensions and settings you use for VS Code.
Hi there niconico! I'm really finding your tutorials very easy to follow. It's been a breeze so far. Though I am curious about the learning curve that's needed to study this. When I went into the discord js documentation it's kind of cryptic and hard to understand. Do you have any tips for someone like me who wants to branch out of the tutorial and learn to navigate on my own?
Practice and just use it. Discord’s api is imo one of the best documentations out there, even though there’s a lot of stuff involved. I’m not sure exactly what ur talking about as part of the learning curve (learning how to code in js, or make discord bots). But the essential skills r knowing fundamentals of how to code and knowing how to read documentation and debug code. Definitely go off the branch and add ur own features and all. That’s the way to learn. Following tutorials the whole way through with no change will significantly decrease the amount that u learn. Be creative with it. Try to do something engaging with some discord community or come up with features that could be for a public bot. Having feedback from others is very helpful and encouraging!
Hi there! I have snatched your code and fixed up the issues caused by the Discord js changes. The bot now mostly works except for one thing: using the "play" command stops the current song and immediately starts the next one instead of adding it to the queue. It's as if a new queue is created each time. I checked the discord player documentation and it says ".createQueue()" should return the existing queue if there already is one, so I really don't know what the problem is... Do you have a hunch as to what it could be?
I didn't know where to write the prefix. Please tell me which file and which line. It's easy to follow, but it's hard to understand because I'm not good at English. But I think the video itself is good to follow.
Hey mate first of all i want to thank you for the easy and good tutorial, first one i actually found good and new. The bot works awsome but i wanted to ask you how do i change the bot initiation from "/" to another key and how do i make the bot like just type "/play speed" instead of having of "/play search searchitem speed"
You can remove the extra options. Try to copy the format from some other slash commands that don’t have the sub options for reference. I also recommend checking out the documentation in the discord-js guide!
Anyone watching this video and having issues with the queue just doing whatever the hell it wants, run this command in console: npm i discord-player@5.3.2 The recent versions of discord-player are super broken, this will install a version that works for the purposes of this video.
Discord pushed an update to how they handle things server side that has made the code in this bot obsolete, it will always stop playing music after 1 minute.
when i tried to do node index.js load in the terminal i got this error i even tried downloading your files from github and i got the same error i did added the .env file and added TOKEN=my token Please could u help me fix this Error: Cannot find module 'dotenv' Require stack: - C:\Users\muham\OneDrive\Desktop\chillbotmusic\index.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15) at Function.Module._load (node:internal/modules/cjs/loader:804:27) at Module.require (node:internal/modules/cjs/loader:1028:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\Users\muham\OneDrive\Desktop\chillbotmusic\index.js:2:16) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Users\\user\\OneDrive\\Desktop\\chillbotmusic\\index.js' ]
Hi there, thx for your tutorial, it was quite easy to follow but I have an interesting situation. When I activate the bot there are no slash commands on the bot. I already executed the "node index.js load" and the bot was invited with the options "bot" & "application.commands" checked. I must wait a certain time or I missed a step? Anyways, great tutorial and thx
Whenever i install the name packages i get like 100 errors and a few warns and i cant really tell what kind some say i miss permission to edit stuff and so on
Note: This problem has been solved. Solution in replies. Hi. I'm having a small problem. When I use the "node index.js load" the console says "Deploying slash commands" but then it says "S[50001]: Missing Access". Thanks in advance for help. I'm sure i just made a mistake in code.
@@pepinatrojkarova6068 I had the same issue, basically, you're gonna want to go to your discord developer portal, go to OAuth2, check the applications.commands box, then copy the url it generates, paste that url into the browser, then accept the permission on the server you want it on
Followed the tutorial and managed to deploy it, everything's fine, bot shows online and command list updated to the server. However my bot does not respond to my slashcommands. I'm getting "The application did not respond". Any ideas?
awesome video and great community, how do i keep this bot online, i have used replit and a server hosting site in the past but idk how to do it with a local Bot. i am unsure as to how this works.
Hi this was a great video super easy to understand for someone who has never worked with code before in his life. Was wondering if it was possible to add a prefix to this bot? if so how would you go about doing it ? even if you could point me in the right direction it would be helpful. thank you again.
Slash commands don’t have prefixes. What I would recommend is naming the slash commands individually so they are prefixed with something. For example, instead of /play make it /cplay and instead of /queue make it /cqueue
Thanks for the video! I'm having a few issues though, when I try to play a song from an url, it just returns "No results" to me. when I use the search function, it finds it but I can't hear the bot
Really liked your video. Can you please share the VS code extension which you are using to smooth cursor (|) movement? Or is it just your OS? It's buttery smooth and got a cool animation while scrolling
I can't decide to actually choose language for my bot, Python seems to be much easier, but it has a small amount of tutorials, tho it's very powerful as JS, but JS has much more tutorials. Which one do you guys prefer?
I think JS is not much harder than Python if you decided to follow the video tutorial rather than make it from scratch. I'd say, choose one tutorial that seems detailed enough and just start following that! You can easily try out to use the other one later because you will learn not only how to code but also how discord bots and their codes work. But as you pointed out, I think there would not be many beginner's guides, especially for d.py 2.0 or one of its successors, which supports the latest features. P.S. I think Python is not very easier than JS technically, it's just way 'less annoying'!
i strongly recommend JS. it's got more tutorials/bigger community as mentioned by neon favor. But additionally, the docs for d.js is 1000x better than the d.py docs. Once you familiarize urself with javascript, if u want really neat and clean code, convert to typescript, which is javascript with typing
No need to have seperate subcommands, just treat it like a chrome search, if http is present - it's a link. If not, its a query; you can use the actual url to determine if it's a playlist or not
I have a question, does the bot take music from TH-cam? if the bot pulls music from youtube i would like to learn how to make the bot pull music from spotify. Sorry for my English I'm from Spain
thx for the video i got it working but i need help with a couple of things 1-how can i make the bot stay idle in a voice chat for like 5 mins so it doesnt leave as soon as the song is over? 2-how can i add a command to loop/repeat the current song? appreciate the help
Hello nico, I watched your video teaching you how to make a music bot in discord, I wrote the code the way it was in the video, however when I try to load it says that an error occurred, saying that the code should receive a builder c. I tried everything and even agr could not solve and I would ask for your help. I'm sorry for my bad English, I'm from Brazil and i loved the video.
Hi, thanks for the cool video, but there is a question. When I enter "node index.js load" I get an error *index.js:36 client.slashcommands.set(slashcmd.data.name, slashcmd) TypeError: Cannot read properties of undefined (reading 'name') * The code is exactly the same as in the video
it's done through the discord-player package. I'm not sure exactly how it actually works, but it probably uses an alternative method that isn't using the normal spotify api since that requires an api key which is not necessary for discord-player
Thanks, it works perfectly, I just had to spend some time modifying it so it would work with my existing event and slash handlers. You can literally play any TH-cam video lol (as long as it's not over 12 minutes I'm finding, otherwise it'll error out)
Hi there I loved the video but I encountered a hiccup, my terminal when trying to make a demo is saying "Cannot find module '@discord-api-types/v9'". Can anyone help me to fix it?
when i tried it with the prefix command, it does send the confirmation message but did not play the song. I am sure that there are no errors with the command, i coded correctly, it searches correctly, i also added error checks, but not playing the song :( what could be the problem? if you want, i can post the code on pastebin and edit this msg adding the url of that.
yes it is possible. If you read the discord-player docs you should find more information about this discord-player.js.org/docs/main/master/class/Track My guess would you would have to setup something that "streams" the music data constantly to the discord player which would then be able to play it in VC. It does come with some difficulty and I personally do not actually know the specifics of how it would be implemented. You'd have to do some research and poking around on your own.
when i try doing node index.js load in the terminal it says TypeError: Cannot read properties of undefined (reading 'name'), on the 36th row in index.js
After following the video and getting to the last step where I "node index.js load" i get this error. Any suggestions? node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module 'C:\Users\vgarc\Desktop\JS\index.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []
i dont plan to continue with the music bot series. There's a lot more features that I could've covered here with the bot, but decided not to as the video was already reaching almost an hour long. I recommend you go check out the resources in the video description to read the documentation and think of an implementation strategy yourself. It'll be a great learning exercise. You may also want to join the discord server discord.niconiconii.xyz where there might be others that can help you
My bot isn't responding, the slash commands loaded correctly and i could log in in the terminal tho, how can i fix it? Great tutorial bro, i learned a lot with it
Why would you have an /play info command if you can easily fit that also in the queue **Currently Playing**: [Song] _time-bar_ **Queue**: 1... 2... 3...
@@Niconiconii I did. Also thanks for the awesome video! Helped me alot understanding how to do a music bot. I did it a bit different since i already had a own event handler and command handler. But i got stuck with how to actually play the songs and so on. I also merged all the play commands by filtering the string just to make it a bit cleaner.
is it possible to host this bot on a server? ive done a similar method but when i try and host it it wont work. i think its because i dont know how to install ffmpeg onto the server. do you know if its possible?
I was so excited about how clear and concise this tutorial was... It was so good I was getting concerned. As always, I get an error that I find impossible to fix: node:internal/modules/cjs/loader:998 throw err; ^ Error: Cannot find module '@discord-api-types/v9' Any help?
@@SebaSefu For me, it wasn't actually any of that. The coding in this video just wasn't right for some reason. I literally reviewed the video next to my code for over an hour. Then, I sent it to a friend of mine who codes Discord bots, and he was pointing out errors left and right. After he swept through it all and told me what to change, it worked flawlessly.
I'd like to add, this isn't Nico's fault. Things change, and I didn't name my files exactly as he did, so.. There could have been a plethora of different reasons why it didn't work based on just the video.
discord had an update since this video came out. the versions that i have installed may be different. if you go to the github and use the package.json versions you’ll have the same exact code work
I coded it very differently from the previous tutorials, so it will be a bit difficult to add to the other bot. Music bots tend to be a bit heavier on usage so I recommend keeping them actually separate from your main bot. If you want to use the same bot account you could just use the same token and it will work flawlessly!
Hey, I did everything like you, and when I wanna turn my bot on, this happen: Cannot find module 'dotenv' Throw err; ^ Require stack: *probably 10 or so lines* Code: Module not found', requireStack: (my disk here) } Node.js v18.12.1 [nodemon] app crashed - waiting for file changes before starting
i followed this tutorial pretty well and the only problem i encountered was with the bot in discord, all the code was perfect, nothing wrong, but in discord, every time i would run a command it would say "the application did not respond" can you please help me
Is there an updated guide of this? Hate when they change version of language and everything goes shit itself grrr, they changed a lot starting from this GatewayIntentBits and such ... which I managed with low knowledge of node js (always "played"with javascript in rpg maker mv...) to find GatewayIntentBits.Guilds and GatewayIntentBits.GuildVoiceStates but Im getting a error with the collection().
Is there a way to prevent someone from entering a float when trying to skip pages or look at a queue page? Whenever someone entered a float in the field, it would crash my bot.
Hi. I really liked your way of explaining, but I did some mistakes that I've could fix by mysel or at least most of them, I have this error that says "TypeError: Cannot read properties of undefined (reading 'createQueue') ...\slash\play.js:33:47)" and I'm stuck with that, I don't know what to do. Help please :c
I think youtube playlist mixes are a bit weird. For some reason it just doesn't work with the playlist things. I'm not sure why. I previously made a music bot that was supposed to be able to use playlists as well and I searched in a completely different method but couldn't get them to work with playlist mixes
Not working, when /play searchterm (any song), joins the VC channel, sends the embed with song etc, but no sound and a lot things in console, among others: Cannot play something that has already ended.
This video took me probably a total of like 20 hours to create, so it would be greatly appreciated if you could leave a like if you found it helpful!
Thank you for watching :)
@Niconiconii hey niconiconii will you make a video on how to keep a bot online 24/7 pls as when I close the VS CODE (where I have written the code) the bot automatically gets offline...
Pls reply 😭
@@avgamer8050 he has given sites that'll do that for you
@@Gort-ft4ey where? lol what the point to write that he has given something but no links for it ....
@@avgamer8050 just host the bot bro👍it would be online for months
god bless. you went straight to the point instead of a 5 min long intro or whatever most people do. im hungry for these kinds of tutorials.
What a great and comprehensive tutorial! I wanted to ask about displaying the exact elapsed time of the currently playing song, since I wanted to display that in the info page as well. Regardless, this video tackled the essentials that I was mostly interested with, and I'm glad to say that this is very well done!
Make more of these! I love them and very handy and easy to follow
Great video, really helped get me started on my own bot. I would be super interested in a video going through some of the extensions and settings you use for VS Code.
Thank you i made it work after some tweaks, it needed couple lines to be updates because of new discord.js version.
What did you update if you don't mind me asking?
I wanna know as well pls
look at the github page guys i made a pull request all lines you need to update are there
@@CodeEnthusiast78912 ye I checked it, but is was a mistake on my part haha
copy paste did the trick :D
thanks man ! its been exactly a year since this video was created, i just realized haha
Hi there niconico! I'm really finding your tutorials very easy to follow. It's been a breeze so far. Though I am curious about the learning curve that's needed to study this. When I went into the discord js documentation it's kind of cryptic and hard to understand. Do you have any tips for someone like me who wants to branch out of the tutorial and learn to navigate on my own?
Practice and just use it. Discord’s api is imo one of the best documentations out there, even though there’s a lot of stuff involved.
I’m not sure exactly what ur talking about as part of the learning curve (learning how to code in js, or make discord bots). But the essential skills r knowing fundamentals of how to code and knowing how to read documentation and debug code.
Definitely go off the branch and add ur own features and all. That’s the way to learn. Following tutorials the whole way through with no change will significantly decrease the amount that u learn. Be creative with it. Try to do something engaging with some discord community or come up with features that could be for a public bot. Having feedback from others is very helpful and encouraging!
I think u think like me I was abt to code a music bot and voila you are here :) ❤️
Glad you found it helpful
I always get thrown "No results", no matter which music video i try under 5 minutes length. Can anyone help?
Hi there! I have snatched your code and fixed up the issues caused by the Discord js changes. The bot now mostly works except for one thing: using the "play" command stops the current song and immediately starts the next one instead of adding it to the queue. It's as if a new queue is created each time. I checked the discord player documentation and it says ".createQueue()" should return the existing queue if there already is one, so I really don't know what the problem is... Do you have a hunch as to what it could be?
hey would you mind to share with me how to fix this code? i'll be much appreciated
im getting a createQueue error too (says its not a function) can you share your code?
@@joneswr1 same bruh
I didn't know where to write the prefix.
Please tell me which file and which line.
It's easy to follow, but it's hard to understand because I'm not good at English. But I think the video itself is good to follow.
it's a slashcommand handler, sou you just put /(command)
Thank you for the well-explained tutorial.
Hey mate first of all i want to thank you for the easy and good tutorial, first one i actually found good and new. The bot works awsome but i wanted to ask you how do i change the bot initiation from "/" to another key and how do i make the bot like just type "/play speed" instead of having of "/play search searchitem speed"
You can remove the extra options. Try to copy the format from some other slash commands that don’t have the sub options for reference. I also recommend checking out the documentation in the discord-js guide!
Awesome video so easy to follow
Thank you
he can't find the discord api type module in the index.js can you help me ?
Anyone watching this video and having issues with the queue just doing whatever the hell it wants, run this command in console:
npm i discord-player@5.3.2
The recent versions of discord-player are super broken, this will install a version that works for the purposes of this video.
Thank you so much
Thank you so much bro, anyway can you do an extra video on how to make loop command?
Will there be updated video/code with new discordjs things?
Discord pushed an update to how they handle things server side that has made the code in this bot obsolete, it will always stop playing music after 1 minute.
I have the same issue
At the beginning you used two npm commands and then at the end you used a node command, are those part of the ffmpeg package?
when i tried to do node index.js load in the terminal i got this error i even tried downloading your files from github and i got the same error i did added the .env file and added TOKEN=my token
Please could u help me fix this
Error: Cannot find module 'dotenv'
Require stack:
- C:\Users\muham\OneDrive\Desktop\chillbotmusic\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Users\muham\OneDrive\Desktop\chillbotmusic\index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'C:\\Users\\user\\OneDrive\\Desktop\\chillbotmusic\\index.js' ]
Hi there, thx for your tutorial, it was quite easy to follow but I have an interesting situation.
When I activate the bot there are no slash commands on the bot. I already executed the "node index.js load" and the bot was invited with the options "bot" & "application.commands" checked. I must wait a certain time or I missed a step?
Anyways, great tutorial and thx
Whenever i install the name packages i get like 100 errors and a few warns and i cant really tell what kind some say i miss permission to edit stuff and so on
Note: This problem has been solved. Solution in replies.
Hi. I'm having a small problem. When I use the "node index.js load" the console says "Deploying slash commands" but then it says "S[50001]: Missing Access". Thanks in advance for help. I'm sure i just made a mistake in code.
i have the same error did you find a waqy to fix it?
Sadly not yet. And the discord server wasn't of any help either.
@@pepinatrojkarova6068 I had the same issue, basically, you're gonna want to go to your discord developer portal, go to OAuth2, check the applications.commands box, then copy the url it generates, paste that url into the browser, then accept the permission on the server you want it on
@@mcmatt186 Thanks a lot. Worked!
Followed the tutorial and managed to deploy it, everything's fine, bot shows online and command list updated to the server.
However my bot does not respond to my slashcommands. I'm getting "The application did not respond". Any ideas?
awesome video and great community, how do i keep this bot online, i have used replit and a server hosting site in the past but idk how to do it with a local Bot. i am unsure as to how this works.
I downloaded ffmpeg-static, but the audio in my channel only comes out of one speaker/side. Any solution?
Hi this was a great video super easy to understand for someone who has never worked with code before in his life. Was wondering if it was possible to add a prefix to this bot? if so how would you go about doing it ? even if you could point me in the right direction it would be helpful. thank you again.
Slash commands don’t have prefixes. What I would recommend is naming the slash commands individually so they are prefixed with something. For example, instead of /play make it /cplay and instead of /queue make it /cqueue
@@Niconiconii thank you i will try this
I did everything correctly & got the bot to log in, but I don't see the slash commands when I type "/" in my chatroom. Any reasons?
u need to run it with the load option
*node index.js load*
Hope this helps!
Hey do you have any idea why when I'm skipping a song. It skips the current song + the first song of the queue ? I'm using the same code as you
I'm need python for this?
Can you make a video on hosting this bot? It would be very appreciated.
Can u make a tutorial about trading bots (Like the trading feature of MEE6) ?
Thanks for the video!
I'm having a few issues though, when I try to play a song from an url, it just returns "No results" to me. when I use the search function, it finds it but I can't hear the bot
Maybe you are missing the audio library
Really liked your video. Can you please share the VS code extension which you are using to smooth cursor (|) movement? Or is it just your OS? It's buttery smooth and got a cool animation while scrolling
made a tutorial about it on my channel. you should find it in the videos tab of my channel
@@Niconiconii sure thanks!!
thanks for the tutorial, somehow my bot is joining the channel but there is no audio playing :x I think i have the dependencies installed too...
I can't decide to actually choose language for my bot, Python seems to be much easier, but it has a small amount of tutorials, tho it's very powerful as JS, but JS has much more tutorials. Which one do you guys prefer?
I think JS is not much harder than Python if you decided to follow the video tutorial rather than make it from scratch. I'd say, choose one tutorial that seems detailed enough and just start following that! You can easily try out to use the other one later because you will learn not only how to code but also how discord bots and their codes work.
But as you pointed out, I think there would not be many beginner's guides, especially for d.py 2.0 or one of its successors, which supports the latest features.
P.S. I think Python is not very easier than JS technically, it's just way 'less annoying'!
i strongly recommend JS. it's got more tutorials/bigger community as mentioned by neon favor. But additionally, the docs for d.js is 1000x better than the d.py docs. Once you familiarize urself with javascript, if u want really neat and clean code, convert to typescript, which is javascript with typing
@@Niconiconii aswell as discord.py no longer having continued support
@@snxphy woah what happened to that lol
@@Niconiconii i think something to do with discord themselves and the developer giving up, cant remember.
Awesome! Thanks so much
No need to have seperate subcommands, just treat it like a chrome search, if http is present - it's a link. If not, its a query; you can use the actual url to determine if it's a playlist or not
Hello, seems like i have kind of a problem with embed, it says, that MessageEmbed is not a constuctor. Could you please help me? ^_^
Change it to EmbedBuilder
really so helphful,thanksss
wheeze
thank you again brother
no problem
I have a question, does the bot take music from TH-cam? if the bot pulls music from youtube i would like to learn how to make the bot pull music from spotify. Sorry for my English I'm from Spain
thx for the video
i got it working but i need help with a couple of things
1-how can i make the bot stay idle in a voice chat for like 5 mins so it doesnt leave as soon as the song is over?
2-how can i add a command to loop/repeat the current song?
appreciate the help
did you run into the problem of the guilds not working?
Can you do a loop.js slash command please,maybe added it in github please?Thank you
I will make a follow up video for more features and improvements :)
Wheres the code for actually playing the queue cause I didn't see it?
Nice video, but I would be glad if can make an extra part which explains how to /loop
The way the package handles it makes looping a little harder to do. The video was already quite long so I didn’t want to make it any longer
@@Niconiconii could u do an extra video for the loop command would be really helpful
what about to play 24/7?
hi hopefully you see this comment I'm new to coding In the index.js file when setting up the const why do some have {} example const {REST}
Hello nico, I watched your video teaching you how to make a music bot in discord, I wrote the code the way it was in the video, however when I try to load it says that an error occurred, saying that the code should receive a builder c. I tried everything and even agr could not solve and I would ask for your help. I'm sorry for my bad English, I'm from Brazil and i loved the video.
Hi, thanks for the cool video, but there is a question. When I enter "node index.js load" I get an error
*index.js:36
client.slashcommands.set(slashcmd.data.name, slashcmd)
TypeError: Cannot read properties of undefined (reading 'name')
*
The code is exactly the same as in the video
same
if you have an empty .js file in your commands folder, name comes out as undefined cause theres no name in that certain .js file
How would you play spotify songs? Do you have to use any spotify api?
it's done through the discord-player package. I'm not sure exactly how it actually works, but it probably uses an alternative method that isn't using the normal spotify api since that requires an api key which is not necessary for discord-player
Love the video but it wont load my slash commands
run this: node index.js load
Thanks, it works perfectly, I just had to spend some time modifying it so it would work with my existing event and slash handlers. You can literally play any TH-cam video lol (as long as it's not over 12 minutes I'm finding, otherwise it'll error out)
Yea it’s something to do with the package there’s fixes but it’s not easy to do
i got an error said 'MessageEmbed is not a constructor'. i would be gladful if you help me
i have a erroer : Error: Cannot find module 'discord.js
pls help
Hi there I loved the video but I encountered a hiccup, my terminal when trying to make a demo is saying "Cannot find module '@discord-api-types/v9'". Can anyone help me to fix it?
Remove the @
when i tried it with the prefix command, it does send the confirmation message but did not play the song. I am sure that there are no errors with the command, i coded correctly, it searches correctly, i also added error checks, but not playing the song :( what could be the problem? if you want, i can post the code on pastebin and edit this msg adding the url of that.
same problem
why is it that none of this matches the actual discord.js documentation?
hey, i can't understand how to download the ffmpeg, can you explain?
do npm i ffmpeg-static
SyntaxError: Identifier 'Discord' has already been declared comes up with this what to do?
hey for the queue,
can u say the command for saving the queue?
My bot automatically logs out after 60 seconds :(
Komutları kullanınca uygulama yanıt vermedi diyor sonra çalışıyor. O uygulama yanıt vermediyi nasıl kaldırabilirim?
any way to make the bot play a file uploaded to discord? ex: upload a mp3 file to discord and make the bot play it
yes it is possible. If you read the discord-player docs you should find more information about this discord-player.js.org/docs/main/master/class/Track
My guess would you would have to setup something that "streams" the music data constantly to the discord player which would then be able to play it in VC. It does come with some difficulty and I personally do not actually know the specifics of how it would be implemented. You'd have to do some research and poking around on your own.
Like the channel name lol
hi again can you share how you came about building this? you seem to just know how a lot of this works how did you figure it all?
figured it out at some point. u just gotta keep learning and keep building :)
when i try doing node index.js load in the terminal it says
TypeError: Cannot read properties of undefined (reading 'name'), on the 36th row in index.js
also i closed visual studio code and it gave me the "MODULE_NOT_FOUND" error and can't even do "node ." anymore
After following the video and getting to the last step where I "node index.js load" i get this error. Any suggestions?
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'C:\Users\vgarc\Desktop\JS\index.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
U made a typo somewhere probably. Need to see the code. I recommend joining the discord for hekp
@@Niconiconii I also get this error
Can you make tutorial how to make /loop? That will be useful
i dont plan to continue with the music bot series. There's a lot more features that I could've covered here with the bot, but decided not to as the video was already reaching almost an hour long. I recommend you go check out the resources in the video description to read the documentation and think of an implementation strategy yourself. It'll be a great learning exercise. You may also want to join the discord server discord.niconiconii.xyz where there might be others that can help you
My bot isn't responding, the slash commands loaded correctly and i could log in in the terminal tho, how can i fix it? Great tutorial bro, i learned a lot with it
Would need to see code to help u debug. I recommend joining the support server
@@Niconiconii aight, ty again. I really learned so much with you, do you know a website that can host a bot 24/7 for free?
@@Redyf th-cam.com/video/p9rClbMwGjE/w-d-xo.html
Why would you have an /play info command if you can easily fit that also in the queue
**Currently Playing**: [Song]
_time-bar_
**Queue**:
1...
2...
3...
U can merge the two if u want. This is just the style I like lol.
@@Niconiconii I did. Also thanks for the awesome video! Helped me alot understanding how to do a music bot. I did it a bit different since i already had a own event handler and command handler. But i got stuck with how to actually play the songs and so on.
I also merged all the play commands by filtering the string just to make it a bit cleaner.
is it possible to host this bot on a server? ive done a similar method but when i try and host it it wont work. i think its because i dont know how to install ffmpeg onto the server. do you know if its possible?
I was so excited about how clear and concise this tutorial was... It was so good I was getting concerned. As always, I get an error that I find impossible to fix:
node:internal/modules/cjs/loader:998
throw err;
^
Error: Cannot find module '@discord-api-types/v9'
Any help?
same error. apparently nobody in the fucking world has a fix.
Same problem, have you npm i @discord-api-types ?
It works for me now
@@SebaSefu For me, it wasn't actually any of that. The coding in this video just wasn't right for some reason. I literally reviewed the video next to my code for over an hour. Then, I sent it to a friend of mine who codes Discord bots, and he was pointing out errors left and right. After he swept through it all and told me what to change, it worked flawlessly.
I'd like to add, this isn't Nico's fault. Things change, and I didn't name my files exactly as he did, so.. There could have been a plethora of different reasons why it didn't work based on just the video.
discord had an update since this video came out. the versions that i have installed may be different. if you go to the github and use the package.json versions you’ll have the same exact code work
@discordjs/opus not working anymore, is this required or can i skip this?
Btw Nico Can I add this code to the bot already coded, followed by ur tutorials. I really want to add this to the main bot
I coded it very differently from the previous tutorials, so it will be a bit difficult to add to the other bot. Music bots tend to be a bit heavier on usage so I recommend keeping them actually separate from your main bot. If you want to use the same bot account you could just use the same token and it will work flawlessly!
hi me again, the bot stopped playing spotify out of the blue...
What's your theme? and great video
tokyo night and thanks!
how would you add autoplay?
Hey, I did everything like you, and when I wanna turn my bot on, this happen:
Cannot find module 'dotenv'
Throw err;
^
Require stack:
*probably 10 or so lines*
Code: Module not found',
requireStack: (my disk here)
}
Node.js v18.12.1
[nodemon] app crashed - waiting for file changes before starting
Any help?
Did node index.js load into the terminal and nothing is happening
i followed this tutorial pretty well and the only problem i encountered was with the bot in discord, all the code was perfect, nothing wrong, but in discord, every time i would run a command it would say "the application did not respond" can you please help me
@@notanerdstudent how do i fix it?
@@notanerdstudent i got it to work but now it just says (*bot name) is thinking and nothing else
Feel free to join the discord server for more help discord.niconiconii.xyz
@@marag598 Hi, how did you get it work? I have the same issue...
what do i need to change to change the prefix into a "!"
Im hosting on heroku, but the bot is showing deafened
Is there an updated guide of this? Hate when they change version of language and everything goes shit itself grrr, they changed a lot starting from this GatewayIntentBits and such ... which I managed with low knowledge of node js (always "played"with javascript in rpg maker mv...) to find GatewayIntentBits.Guilds and GatewayIntentBits.GuildVoiceStates but Im getting a error with the collection().
look down
Unfortunately I can't install @discordjs/opus :(
Hello there!
Hello :)
Is there a way to prevent someone from entering a float when trying to skip pages or look at a queue page? Whenever someone entered a float in the field, it would crash my bot.
Use Math.round?
Bot crashes when i put random letters or numbers on /play song [url: ], is there a way to handle that error? Btw great video, ty!
Use Regex to check it is indeed a yt link
@@Niconiconii fixed, thanks!
Hi. I really liked your way of explaining, but I did some mistakes that I've could fix by mysel or at least most of them, I have this error that says "TypeError: Cannot read properties of undefined (reading 'createQueue') ...\slash\play.js:33:47)" and I'm stuck with that, I don't know what to do. Help please :c
Need more context to the code to help I solve this. I recommend joining the discord suooort server
@@Niconiconii Alright then, and thank you.
how did u fix ?
how do i make that he can find spotify songs?
I love you man
I can start the bot but the slash commands say your not authorized to perform this action
You need to invite the bot with slash command permissions checked in the oauth
another question, the /play playlist bot is not playing the youtube playlist mix, is there any way to make it play?
I think youtube playlist mixes are a bit weird. For some reason it just doesn't work with the playlist things. I'm not sure why. I previously made a music bot that was supposed to be able to use playlists as well and I searched in a completely different method but couldn't get them to work with playlist mixes
Are you using v13 or which version pls reply.
v13.6
@@goodboyneon ohh thanks is it a new version which came in November?
yes it is. this is the current stable version for 2022
@@Niconiconii thanks !!! Niconiconii
Hi great tutorial but my bot is the hole time on deafened; how can i fix that ?
Its automatically done so for privacy purposes. The bot just won’t listen to any audio in the vc. It can play music regardless
@@Niconiconii i whas forget to install ffmpeg-static
heyy i cant use the slash command you know why ?
Imagine being first, couldn’t be me anyways
ehehe
can u make a prefix command for the music system?
They all use slash commands, so there’s not really a prefix thing.
Not working, when /play searchterm (any song), joins the VC channel, sends the embed with song etc, but no sound and a lot things in console, among others: Cannot play something that has already ended.
It's an ytdl fault.
@@_rs2 how can I fix this?
It’s outdated. I will do a new video soon