Edit Nov 20: This guide is outdated because the play command code changes all the time. I recommend cloning my bot which is on GitHub if you're loo...
For further actions, you may consider blocking this person and/or reporting abuse
Hello Nir, I got a problem at "Something went wrong with searching the video you requested :("
Did you generate an API key from youtube? And did you clone my repo or copy code?
I play the song and the bot suddenly exits the voice channel and says "Cannot play song"
can't play playlist and bots don't join on Voice Channel
thepracticaldev.s3.amazonaws.com/i...
So you did something wrong, did you generate an API key from youtube?
yes i generated API key from youtube
Did you install everything I listed? Git, ffmpeg etc
I installed everything in your package.json, and I didn't change it at all
I mean git, ffmpeg and python 2.7
It's in the prerequisites
I have not installed ffmpeg and python2.7 on my computer, and I only install git
What should I do after installing ffmpeg, python 2.7 and git?
You need to install them all, doesn't matter in which order
I will try if there is a problem I will call you back, Thank you for the help.
hello Nir, now the problem is here and I try to install node-opus in visual studio which is always error
thepracticaldev.s3.amazonaws.com/i...
Hello Nir
Having error
TypeError: Cannot read property 'isTriviaRunning' of undefined
Did you extend the Guild class in index.js?
I seem to have an issue with extend for the guild class line.
"Structures.extend('8', Guild => {
^
TypeError: Cannot read property 'extend' of undefined"
Did you import Structures like I did above?
const { Structures } = require('discord.js');
Ya, It's in line 2, But when I 'node .' it still doesn't run due to the error
Did you install the master branch of discord.js?
npm install discord.js#master
I tried to but it says that the '#' is an invalid character or smth
Sorry, it's
npm install discordjs/discord.js
And you need git in order for this to work
hello nir,
I want to ask what is the purpose of git? and how to install it. sorry i am a beginner
I get this error when using a link: 'No filter selected. Expected one of: idParam, myRated, chart, id'
Works fine when using the search function, only happens with links
What link did you try?
any youtube link, when you do !play it gives this error. But not if you just do !play
This error is on your end, it's a youtube API error. I'll try to figure out why you're getting it
Did you modify any code? Also check if your dependencies are the same version as the repo's
Didn't modify anything no, what do you mean with repo?
Repository. Compare your package.json with the package.json on my repo: github.com/galnir/Master-Bot
my ytdl-core is 0.29.7 instead of 0.29.5 but youtube api and discord js + commando are the same
Found the issue, was missing a / or \ somewhere in the query .split
Great article!
Hey, everything seems to be working, but as soon as the bot joins the vc, it automatically leaves
Yeah there's an issue now with ytdl-core/YouTube
Is there any way to get around the issue, or is it like that until youtube fixes it?
Try removing line 252 in play.js
If that solves it tell me, not near a pc atm
I deleted the line, there seems to still be an issue, is this the right bit of code?
quality: 'highestaudio',
Yeah so there's an issue with ytdl, I just saw more ppl reporting it
Update
Hey, updating ytdl-core to the latest version solves that error.
npm install ytdl-core@latest
I cloned your bot and installed the necessary programs. I get this error now, and can't seem to track it down.
An error occurred while running the command: TypeError: Cannot read property 'duration' of undefined
Seems to occur with whichever youtube link I enter, whether a long or short video.
Thoughts appreciated.
Hey, please open an issue in the bot's repo on Github and fill the issue template
github.com/galnir/Master-Bot
UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
hi sorry to disturb, after install git it able to run , and when trying make it online, it return error as above shown in image. is ti means my discord id in config.json is wrong?
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
also got this error after install master discord.js
Upon running the node.js and fixing all the missing modules. I get this error and I can't find a solution.
First, the bot starts without a problem but after trying to play a song the bot joins the channel and crashes with the error: secretbox.methods.close is not a function.
Any help is appreciated,
Thanks in advance.
D:\Git\Private\Master-Bot-master>node index.js
Ready!
D:\Git\Private\Master-Bot-master\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:262
return [secretbox.methods.close(buffer, this._nonceBuffer, secret_key), this._nonceBuffer.slice(0, 4)];
^
TypeError: secretbox.methods.close is not a function
at StreamDispatcher._encrypt (D:\Git\Private\Master-Bot-master\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:262:33)
at StreamDispatcher._createPacket (D:\Git\Private\Master-Bot-master\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:281:49)
at StreamDispatcher._playChunk (D:\Git\Private\Master-Bot-master\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:253:27)
at StreamDispatcher._write (D:\Git\Private\Master-Bot-master\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:107:10)
at doWrite (_stream_writable.js:403:12)
at writeOrBuffer (_stream_writable.js:387:5)
at StreamDispatcher.Writable.write (_stream_writable.js:318:11)
at SingleSilence.ondata (_stream_readable.js:717:22)
at SingleSilence.emit (events.js:315:20)
at SingleSilence.Readable.read (_stream_readable.js:506:10)
Hello Nir, I know everyone says that word but Idk what to say other than that
I checked your bot and used it but there is a small problem, is that it doesn't enter the VC and it doesn't
responds to me ever, I added every thing and the API, youtube API summary I added everything but the bot doesn't respond to me so if you can help I would appreciate that
Make sure you installed all the requirements correctly(python 2.7, ffmpeg) and also make sure that running 'npm i node-opus' doesn't fail
Hello Nir, I got a problem at line 90 like these
const playlist = await youtube.getPlaylist(query); // get playlist data
^^^^^
SyntaxError: await is only valid in async function
pls react this pls...
It shouldn't happen unless you copied code over to another bot. If you want this to work perfectly, clone the master-bot repo and follow the instructions on the repo's page. Also this guide is outdated so it will not work well
SyntaxError: await is only valid in async function
?[90m at wrapSafe (internal/modules/cjs/loader.js:1072:16)?[39m
?[90m at Module._compile (internal/modules/cjs/loader.js:1122:27)?[39m
?[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)?[39m
?[90m at Module.load (internal/modules/cjs/loader.js:1002:32)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:901:14)?[39m
?[90m at Module.require (internal/modules/cjs/loader.js:1044:19)?[39m
?[90m at require (internal/modules/cjs/helpers.js:77:18)?[39m
-can you plz help me with that?
Hello Nir, I know everyone says that word but Idk what to say other than that
I checked your bot and used it but there is a small problem, is that it doesnt enter the vc and it doesnt
responds to me ever, i added every thing and the api, youtube api summary i added everything but the bot doesnt reponds to me so if you can help i would apreciate that
Hi Nir! Thx for this awesome work u r sharing. But I'd still need some more of ur help... I installed discord.js-commendo but it won't recognize it, leaving me with the problem:
"Error: cannot find module 'discord.js-commando'"
I've been searching what could it be for the last couple of days and I've got nothing... What should I do?
I think you misspelled the name of the package, it's as the error says 'discord.js-commando' and not 'commendo'.
It shouldn't throw any errors, all you need to do is install it in the right directory using npm or yarn
Hello, I am a beginner. After basically following your steps and using command !play I have this error and my bot says this:
An error occurred while running the command: TypeError: Cannot read property 'isTriviaRunning' of undefined
You shouldn't ever receive an error like this.
Please contact [my discord id]
This usually happens if you copy code instead of cloning the repository. Make sure you clone it using Git and follow the instructions in the repository
Hello Nir, I imported the packages and got This Error.
TypeError: Cannot read property 'extend' of undefined
Please help!
You did not install the master version of discord.js
enter
npm i discordjs/discord.js
Current you just told us where to put those commands because nothing works for me
hi nir, whenever i give a command the bot says the same response 3-5 times. Pls helpp
how to auto play song without choosing?
Hey! I'm having a lot of problems with the audio quality ('play' command), is there anything I can do to fix? I know it isn't my internet because this happens with any video and on any network.
Hello Nir, i get a problem on the line => const thumbnail = video.thumbnails.high.url; says url is not defined
Did you install everything I listed?
yes it works fine without that line but once that line is added it gives that error
edit - i had to replace the variable of the embed with the yt link for imgs - i.ytimg.com/vi/${song.id}/hqdefaul... for getting the thumbnail instead of that declaration and it still worked fine
I don't know why you're getting thumbnails errors, I run the bot on 2 machines and never got that error
If the bot is playing on server 1, and i use the play command on server 2, it will add it to the queue, and only join server 2 voice channel after it is done in server 1. How do i fix this?
This no longer happens. The bot supports playing on multiple guilds at a time.
TypeError: connection.play is not a function
Sorry for the late response.
This error is emitted because you are using the stable version of discord.js.
In order to use .play() you need to be on the master version
tons of error, outdated sadly, good start tho gained time
i think
Can you elaborate what errors?
Try the solutions I provided in this issue:
github.com/galnir/Master-Bot/issue...
Is there any way around ffmpeg? I'm trying to make it on repl.it but it seems like it doesn't support it :/
Nope :/