#archive-voice
30636 messages · Page 3 of 31
These are my dependancies from package.json file
one sec
Ok, so do this npm i libsodium-wrappers
Okay one sec
Now re - run your bot
Yes
It works
Thank you
😄
No wait
I got another error when I play a song
🥲
Show me
at RequestHandler.execute (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async RequestHandler.push (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13884) 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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13884) [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.
As said, you can't send an empty message
But
That's the thing
It's not an empty message
Show me sending code
bot.distube.on("playSong", (queue, song) => {
if (song.playlist) {
return queue.textChannel.send(
new MessageEmbed()
.setAuthor("Started playing", "https://raw.githubusercontent.com/SudhanPlayz/Discord-MusicBot/master/assets/Music.gif")
.setThumbnail(song.thumbnail)
.setColor("BLUE")
.addField("Playlist's name:", `[\`${song.playlist.name}\`](${song.playlist.url})`, true)
.addField("Playlist duration:", `\`${song.playlist.formattedDuration}\``, true)
.addField("Currently playing:", `[\`${song.name}\`](${song.url})`, true)
.addField("Song duration:", `\`${song.duration} seconds (${song.formattedDuration})\``)
.addField("Requested by", `<@${song.playlist.user.id}>`, true)
.setFooter(`👁️Views: ${song.views} | 👍Likes: ${song.likes} | 👎Dislikes: ${song.dislikes} | ${status(queue)}`)
)
} else {
return queue.textChannel.send(
new MessageEmbed()
.setAuthor("Started playing", "https://raw.githubusercontent.com/SudhanPlayz/Discord-MusicBot/master/assets/Music.gif")
.setThumbnail(song.thumbnail)
.setColor("BLUE")
.addField("Name:", `[\`${song.name}\`](${song.url})`, true)
.addField("Duration:", `\`${song.duration} seconds (${song.formattedDuration})\``)
.addField("Requested by:", `<@${song.user.id}>`, true)
.setFooter(`👁️Views: ${song.views} | 👍Likes: ${song.likes} | 👎Dislikes: ${song.dislikes} | ${status(queue)}`)
)
}
})```
You can't do this sending like this in latest PR of djs .
Oh
?v13-send
v13 changes how sending/editing and replying to messages works. All of these methods now only accept one parameter:
- channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] });
See https://deploy-preview-680--discordjs-guide.netlify.app/additional-info/changes-in-v13 for a full migration guide.
See this
Ahhhhhh
See new sending method as +
Thanks!
😄
Well, it still joins as a listener and not a speaker
And I got the same error again
smh
You want him as speaker in stage ??
It's a music bot, obviously
If it's not speaker, how will it play music?
Oki, I'll check that out
bot.distube.on("playSong", (queue, song) => {
if (song.playlist) {
return queue.textChannel.send({
embed: new MessageEmbed()
.setAuthor("Started playing", "https://raw.githubusercontent.com/SudhanPlayz/Discord-MusicBot/master/assets/Music.gif")
.setThumbnail(song.thumbnail)
.setColor("BLUE")
.addField("Playlist's name:", `[\`${song.playlist.name}\`](${song.playlist.url})`, true)
.addField("Playlist duration:", `\`${song.playlist.formattedDuration}\``, true)
.addField("Currently playing:", `[\`${song.name}\`](${song.url})`, true)
.addField("Song duration:", `\`${song.duration} seconds (${song.formattedDuration})\``)
.addField("Requested by", `<@${song.playlist.user.id}>`, true)
.setFooter(`👁️Views: ${song.views} | 👍Likes: ${song.likes} | 👎Dislikes: ${song.dislikes} | ${status(queue)}`)
})
} else {
return queue.textChannel.send({
embed: new MessageEmbed()
.setAuthor("Started playing", "https://raw.githubusercontent.com/SudhanPlayz/Discord-MusicBot/master/assets/Music.gif")
.setThumbnail(song.thumbnail)
.setColor("BLUE")
.addField("Name:", `[\`${song.name}\`](${song.url})`, true)
.addField("Duration:", `\`${song.duration} seconds (${song.formattedDuration})\``)
.addField("Requested by:", `<@${song.user.id}>`, true)
.setFooter(`👁️Views: ${song.views} | 👍Likes: ${song.likes} | 👎Dislikes: ${song.dislikes} | ${status(queue)}`)
})
}
})```
This is my code now
It's giving same error?
v13 changes how sending/editing and replying to messages works. All of these methods now only accept one parameter:
- channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] });
See https://deploy-preview-680--discordjs-guide.netlify.app/additional-info/changes-in-v13 for a full migration guide.
It is embeds not embed
and embeds is an array
Ah fooking hell
(node:12056) UnhandledPromiseRejectionWarning: TypeError: this.options.embeds?.map is not a function
at APIMessage.resolveData (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\discord.js\src\structures\APIMessage.js:194:36)
at TextChannel.send (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:177:53)
at DisTube.<anonymous> (C:\Users\HP\Documents\GitHub\Sharkymusic\index.js:63:30)
at DisTube.emit (events.js:376:20)
at DisTube.playVoiceChannel (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\distube\dist\DisTube.js:233:30)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async DisTube.play (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\distube\dist\DisTube.js:157:9)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12056) 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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:12056) [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.
What is this supposed to mean now 😭
I changed it to embeds insted of embed
Shoe me code
bot.distube.on("playSong", (queue, song) => {
if (song.playlist) {
return queue.textChannel.send({
embeds: new MessageEmbed()
.setAuthor("Started playing", "https://raw.githubusercontent.com/SudhanPlayz/Discord-MusicBot/master/assets/Music.gif")
.setThumbnail(song.thumbnail)
.setColor("BLUE")
.addField("Playlist's name:", `[\`${song.playlist.name}\`](${song.playlist.url})`, true)
.addField("Playlist duration:", `\`${song.playlist.formattedDuration}\``, true)
.addField("Currently playing:", `[\`${song.name}\`](${song.url})`, true)
.addField("Song duration:", `\`${song.duration} seconds (${song.formattedDuration})\``)
.addField("Requested by", `<@${song.playlist.user.id}>`, true)
.setFooter(`👁️Views: ${song.views} | 👍Likes: ${song.likes} | 👎Dislikes: ${song.dislikes} | ${status(queue)}`)
})
} else {
return queue.textChannel.send({
embeds: new MessageEmbed()
.setAuthor("Started playing", "https://raw.githubusercontent.com/SudhanPlayz/Discord-MusicBot/master/assets/Music.gif")
.setThumbnail(song.thumbnail)
.setColor("BLUE")
.addField("Name:", `[\`${song.name}\`](${song.url})`, true)
.addField("Duration:", `\`${song.duration} seconds (${song.formattedDuration})\``)
.addField("Requested by:", `<@${song.user.id}>`, true)
.setFooter(`👁️Views: ${song.views} | 👍Likes: ${song.likes} | 👎Dislikes: ${song.dislikes} | ${status(queue)}`)
})
}
})```
WTF
embeds takes an array
embeds takes array
See this @fervent bloom
?v13-send
v13 changes how sending/editing and replying to messages works. All of these methods now only accept one parameter:
- channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] });
See https://deploy-preview-680--discordjs-guide.netlify.app/additional-info/changes-in-v13 for a full migration guide.
embeds: [embed, embed2]
Ah
This one
Works ??
Yep
It does
Thank you
NP
how do you get the bot to join a stage channel?
just like you would with regural voiceChannels
message.member.voiceChannel.leave()
Cannot read property 'leave' of undefined
client.on("ready", () => {
var channel = client.channels.cache.find(c => c.id === '697293699519873044')
channel.join();
})```
```(node:26183) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'join' of undefined
that channel doesnt seem to exist
^^^^^ anyone?
i don't think that's about @discordjs/voice but that should be ```js
message.member.voice.channel.leave()
Then it says
message.member.voice.channel.leave() is not a function
are you in a vc when you run that?
Yes. Yes I am.
can you do
console.log(message.member)
It has been removed in dev build
oh yeah, i forgot about that
Then what do I use?
You need to do something like
const { getVoiceConnection } = require('@discordjs/voice')
var connection = getVoiceConnection(message.guild.id)
connection.destroy()
Oh Jesus.
Okay.
They made this way too complicated
Yes I remembered
But New Voice API is very flexible, you can have various events holds that never was there in v12 voice
VoiceConnection and AudioPlayer have different events
Dang
Okay makes sense
@stark cargo Use this
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});```
how do I put it here for the bot to come in as a speaker?
const connection = joinVoiceChannel({
channelId: VoiceChannel.id,
guildId: message.guild.id,
adapterCreator: createDiscordJSAdapter(message.member.voice.channel.id),
selfDeaf : false,
selfMute : false
});
try {
await entersState(connection, VoiceConnectionStatus.Ready, 30e3);
return connection;
} catch (error) {
connection.destroy();
throw error;
}
}
``` message not defined
added message to parameters, it works now, but new error message of cannot read property 'guild' of undefined
npm i libsodium-wrappers
Is it possible to know which channel the bot is currently in from the connection? I use
let connection = getVoiceConnection(newState.guild.id)
@native lance connection.joinConfig.channelId
thank you
Np
module.exports = function spawnAudioResource(nextInQueue) {
return new Promise((resolve, reject) => {
console.log(nextInQueue.videoUrl)
const process = raw(
nextInQueue.videoUrl,
{
o: '-',
q: '',
f: 'bestaudio[ext=webm+acodec=opus+asr=48000]/bestaudio',
r: '100K',
},
{ stdio: ['ignore', 'pipe', 'ignore'] },
);
if (!process.stdout) {
reject(new Error('No stdout'));
return;
}
const stream = process.stdout;
const onError = (error) => {
console.log("error" , error)
if (!process.killed) process.kill();
stream.resume();
reject(error);
};
console.log("process will spawn?")
process
.once('spawn', () => {
console.log("ping")
demuxProbe(stream)
.then((probe) => resolve(createAudioResource(probe.stream, { inputType: probe.type })))
.catch(onError);
})
.catch(onError);
});
}
So following the example I got this code to work in my linux server but doesn't work in my windows 10 machine. process.once doesn't get called nor does the onError. In console last message i see is "process will spawn?" and it's stuck there. any ideas?
and also
const { raw } = require('youtube-dl-exec')
Might be an issue with youtube-dl-exec but can't get my head around solving it, might as well try my chances here
all the extra dependency installed? Like python, etc2
seems like it, when i run the command in terminal i get a stream there also if i console.log the stream variable i get a socket object
try change the option q:true? But that should work though
when q set to 'true' I'm getting bunch of the stream bytes into my vscode terminal, even though not consol.logging anything in the file
well, yeah. q parameter is supposed to mean quiet, which mean don't print unnecessary stream to console. So far, it only work on ubuntu with option q:true.
youtube-dl quirks passing the quiet args, not really sure what I can recommend you, since hydrabolt used q:true before changing it to now q:''
The music play though?
in ubuntu server it plays, in windows it doesn't. execution just hangs there, doesn't want to progress to process.once('spawn', ...
but yeah must be some shennanigans with the module and windows. I shall ask the author or youtube-dl-exec devs
thanks for your time
np
Is Tweetnacl bug not fixed in latest release of @discordjs/voice ??
Slow-mode in both voice channels 
how can bot join stage?
Same code as voice channel
is it recommended to use command handlers in discord.js/voice?
What bug?
@steel crescent This bug
That’s not a bug
If you don’t install one of the three libs you get an error
That’s on the user
We have tweetnacl installed and we still get a bug
It is djs-voice problem not a user problem
That person didn’t have it installed
Not sure what you are on about
Ask hydrabolt , I reported this bug a long time back
It doesn’t matter, the one you linked is not the bug you talk about lol
He didn’t have any of those libs installed
Ok wait I will prove my point
You don’t need to prove your point.
No sodium, no libsodium-wrappers, no tweetnacl
Case closed
Did he show all dependencies ??
Yes
Dependencies are alphabetically sorted
Remove this slow-mode pls
tweetnacl comes before ws
And it’s not there
tweetnacl comes pre-installed with djs BTW
It doesn’t
Nope 👎
Stop with the misleading and wrong messages
It doesn't
Please show me where: https://github.com/discordjs/discord.js/blob/master/package.json#L48-L57
Keep in mind, this lib is for v13 and onwards.
It was in v12, but not in v13 anymore.
You are at wrong channel ask this in #archive-djs-v12-voice-deprecated
ok
My bad Sorry
Crawl
wait new discord.js@dev can't send embed?
It can, it just changed
i wanna join stage
?v13-send
v13 changes how sending/editing and replying to messages works. All of these methods now only accept one parameter:
- channel.send(embed);
+ channel.send({ embeds: [embed, embed2] });
- channel.send('Hello!', { embed });
+ channel.send({ content: 'Hello!', embeds: [embed, embed2] });
See https://deploy-preview-680--discordjs-guide.netlify.app/additional-info/changes-in-v13 for a full migration guide.
ok
You’ll need the use the new voice lib or smth
ok it works but i have to change 126 commands files for embed 
Can’t just use the global find and replace ?
What is guild.me supposed to be?
guild.me.voice.setSuppressed(false);
guild.me? What is that?
ur client as a member of that guild
Guild#me
The client user as a GuildMember of this guild
Ah
How do I check if a channel is a stage?
u can just do if (channel instanceof Discord.StageChannel)
Ah thanks
const Discord = require('discord.js')
module.exports.run = async (bot, message, args) => {
if (!message.member.voice.channel) return message.channel.send(`What? Excuse me? Do you really expect me to execute a MUSIC command without you being in a voice channel? Like how you gonna use them if you can't hear them bruh? Big brain much?`);
const music = args.join(" ");
if (message.member.voice.channel instanceof Discord.StageChannel) {
console.log('true')
message.guild.me.voice.setRequestToSpeak(true);}
bot.distube.play(message, music)
}
module.exports.config = {
name: "play",
aliases: ['p', 'P', 'PLAY']
}```
Bot is online!
[DisTube] Updated youtube-dl to 2021.06.06!
true
(node:10956) UnhandledPromiseRejectionWarning: Error [VOICE_NOT_STAGE_CHANNEL]: You are only allowed to do this in stage channels.
at VoiceState.setRequestToSpeak (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\discord.js\src\structures\VoiceState.js:177:42)
at Object.module.exports.run (C:\Users\HP\Documents\GitHub\Sharkymusic\commands\play.js:9:32)
at Client.<anonymous> (C:\Users\HP\Documents\GitHub\Sharkymusic\index.js:41:17)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)```
But I am in a stage channel
Anyone?
@fervent bloom if you log message.member.voice.channel.type, what do you get
Lemme check. wait
It says stage
Bot is online!
[DisTube] Updated youtube-dl to 2021.06.06!
stage
(node:13280) UnhandledPromiseRejectionWarning: Error [VOICE_NOT_STAGE_CHANNEL]: You are only allowed to do this in stage channels.
at VoiceState.setRequestToSpeak (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\discord.js\src\structures\VoiceState.js:177:42)
at Object.module.exports.run (C:\Users\HP\Documents\GitHub\Sharkymusic\commands\play.js:9:32)
at Client.<anonymous> (C:\Users\HP\Documents\GitHub\Sharkymusic\index.js:42:17)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13280) 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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13280) [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.```

Why is discord like this
can you do this:
go to node_modules/discord.js/src/structures/VoiceState.js, and make this change:
async setRequestToSpeak(request) {
const channel = this.channel;
+ console.log("real type", channel.type);
if (channel?.type !== 'stage') throw new Error('VOICE_NOT_STAGE_CHANNEL');
AudioPlayerError: Status code: 403 My bot plays music but it stops after some hour or so and this error happens can anyone tell me why?
a network error
you just have to handle these and mvoe on
Done, lemme run the command again, gimme a second
ahh! i see i thought of that but asked anyway if something is wrong in my code
ahh no worries, yeah sometimes it is just network error
are you using ytdl-core/discord-ytdl-core/ytdl-core-discord?
yes the 3rd one
should i shift to youtube-dl?
Bot is online!
[DisTube] Updated youtube-dl to 2021.06.06!
stage
(node:5828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of null
at VoiceState.setRequestToSpeak (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\discord.js\src\structures\VoiceState.js:177:38)
at Object.module.exports.run (C:\Users\HP\Documents\GitHub\Sharkymusic\commands\play.js:9:39)
at Client.<anonymous> (C:\Users\HP\Documents\GitHub\Sharkymusic\index.js:42:17)
at processTicksAndRejections (internal/process/task_queues.js:95:5)```
ok, can you make this change:
async setRequestToSpeak(request) {
const channel = this.channel;
+ console.log("this", this);
if (channel?.type !== 'stage') throw new Error('VOICE_NOT_STAGE_CHANNEL');
i would recommend it, yea
K thanks
np
ohh wait lol
first you have to get the bot to join the voice channel before you request to speak
OH jesus
ok phew
Sorry, I'm really new to coding
it's no problem
everyone makes oversights like that lol
I've barely learnt anything tbh XD, but yea, idk how to fix this. Do I async and await?
well with this new voice library, it'd be something like this:
const connection = joinVoiceChannel({ ... });
await entersState(connection, VoiceConnectionStatus.Connecting);
// now you can request to speak
idk what the distube package looks like internally, but if it gives you access to the voice connection, that works ^
alternatively, if it gives you an indicator that the connection is ready to play, that would also work
Hydrabolt add something in New Voice API so that if none of encryption is present, then it will tell that he has some missing dependencies
👍
good idea
What's supposed to be in the brackets after joinVoiceChannel?
are you using discord.js@dev?
Your join channel options
Yes
Ah, since I don't have any options that need to be declared, I can leave it blank right?
then:
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
Oh nvm
These are always required
ngl, this has become very complicated 😭
we're working on a wrapper for @discordjs/voice that is a ready-to-go music bot with queue essentially 👀
WoW
Ohhhh, niceee, that'll definitely be really helpful
👍
i agree the new /voice library is definitely more technical and low-level than d.js v12 voice
This brings me back to a year ago when I started coding discord.js, where I didn't know shit 😭. Time for the hustle now
so no worries if you don't feel comfortable using it just yet
But how can you attach a player in ready event, and then play music in different guilds ??
I saw an example code in your music bot
That will cover only one guild
if I am not wrong
with the wrapper you dont have to concern yourself directly with the player at all
you can just tell it which channel you want to join, give it the URL of a song/video to play, and manage a queue
It says joinVoiceChannel is not defined 🤡
you'll need to import it from @discordjs/voice
https://github.com/discordjs/voice/tree/feat/js-example/examples @fervent bloom some of these will be helpful
Oh right, I forgot about that
just some examples in typescript/javascript on how to use /voice
So it means one player can play in different guilds also ??
not sure exactly about that feature just yet,
but you can also use /voice's players in multiple connections yeah
Oh
if you wanted you could make a radio bot that has a single player and play it across multiple voice connections, in fact this is what the radio-bot example does
That is a radio bot , but then it will be different for music bot who has to play guild specific songs to person , right ??
yep
the music bot example is one queue per guild, and that cannot be shared across guilds
whereas radio bot is a single player for all guilds
yes
For music bot, we need to create separate player for each guild, right ??
yep
same about connections?
well a connection is 1:1 with a guild anyway
so in a music bot, you'd typically have one player for each guild/voiceconnection
ya, just making sure
you could make it fancier and give your music bot a global radio player for ALL voice connections if you wanted
sure, can i have it pls? i love learning from code, i mustly dont make music bots
(sorry discord js devs, but i dont love so much docomentation)
i've not coded that 😅 that's up to developer
but there are two examples that do each thing
the radio bot does one player for all guilds, and the music bot does one player for each guild
you could combine what each does
oh, ok
It says entersState is not defined 🥲
did you import it
I did
nvm, I spelt it wrong while importing, kill me
const Discord = require('discord.js')
const { VoiceConnectionStatus, entersState, joinVoiceChannel } = require('@discordjs/voice')
module.exports.run = async (bot, message, args) => {
if (!message.member.voice.channel) return message.channel.send(`What? Excuse me? Do you really expect me to execute a MUSIC command without you being in a voice channel? Like how you gonna use them if you can't hear them bruh? Big brain much?`);
const music = args.join(" ");
bot.distube.play(message, music)
const connection = joinVoiceChannel({
channelId: message.channel.id,
guildId: message.member.guild.id,
adapterCreator: message.member.guild.voiceAdapterCreator,});
await entersState(connection, VoiceConnectionStatus.Connecting);
if (message.member.voice.channel instanceof Discord.StageChannel) {
message.member.guild.me.voice.setRequestToSpeak(true);}
}
module.exports.config = {
name: "play",
aliases: ['p', 'P', 'PLAY']
}```
C:\Users\HP\Documents\GitHub\Sharkymusic>node .
Bot is online!
[DisTube] Updated youtube-dl to 2021.06.06!
(node:9936) UnhandledPromiseRejectionWarning: Error: Did not enter state connecting within undefinedms
at Timeout.<anonymous> (C:\Users\HP\Documents\GitHub\Sharkymusic\node_modules\@discordjs\voice\dist\util\entersState.js:17:49)
at listOnTimeout (internal/timers.js:555:17)
at processTimers (internal/timers.js:498:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9936) 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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:9936) [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.
oops, for entersState, there should be a 3rd param
OH
the 3rd param is how long in milliseconds you should wait for that state to be entered
if its for vc i'd say maybe 15_000 is a good value? you could up it if on a bad network
I don't have a bad network but I do have a terrible PC 😭
AAAAAA OMGGG THANK YOU I MIGHT CRY IT WORKS
Wait how do I use the disconnect command now?
connection.disconnect() ?
🎉
But, it's a different file
lol atm i am currently adding a disconnect method
for now you will have to do joinVoiceChannel({ channelId: null, ... }); to disconnect
where ... is the same stuff as if you were actually joining
Bruh
I can't do that cuz it's already in a voicechannel
It waits to connect, but it's already connected...
You can do connection.destroy() , right ??
yep but that destroys it entirely
if you don't want to reuse it that works
but if you wanted to disconnect and keep the voice connection (e.g. to rejoin in a few seconds), you have to do this
for most purposes .destroy() is fine tho
^^^^^
Do connection.destroy()
But for that I'll have to define connection
You can get connection BRUH
if it's already connected, entersState won't wait
It did
I have 2 different files. I defined connection in the play.js file and now disconnect.js file I'll have to define it
const { getVoiceConnection } = require('@discordjs/voice')
const connection - getVoiceConnection(message.guild.id)
connection.destroy()
works ??
Testing, PC a lil slow, sorry
ok
Yes, it works, thank you so much
😄
Why someone added slowmode in voice channels ??
To prevent spamming I guess 
Who spams here ??
Idk
its just to keep the channel in order. It would be a mayhem in #archive-djs-v12-deprecated if there would be no slowmode. Same thing here
But I am talking about #archive-voice #archive-djs-v12-voice-deprecated channels not about other channels.
Rarely, people ask about issues here and you have such a long cooldown of 15 seconds.
Reduce it to 5 seconds at least
i can suggest that to the admins
Just suggest them 🙂
I dont mind that much about it, at least it lessen the spam, I've seen ppl with typing each word every line
^this, its only a problem for people who shotgun messages by typing a lot of message instead of 1 concise message
files: request.options.files ?? [],
^
SyntaxError: Unexpected token '?'
New dev version gives error
update to node 14
ok
Show me full error
What is on line 20 in index.js ??
how can i send buttons with v13? because old way was removed 😓
ping reply me if you can help
not voice related
it is i am working on music bot
if not then sorry for off-topic
that... doesnt make it really related to voice
ask in #djs-help-v14
this channel is for @discordjs/voice
just remember in the future xd. Its all good
Change that line to message.member.voice.channel.id
Is it possible to add a new AudioPlayerStatus "errored" to the API? Listening to Idle status and errors ~~may ~~ is causing both of them being triggered on error.
Now show me line 20 again
Did you read my message?
I read it, you can attach an event to a player not to a status class
you need to change basic class files.
That will not change anything, it'll still fire twice
I'm asking the devs if they can add it to the library natively, I don't want to mess with it.
Oh sorry I didn't read second part,
No it will trigger both events as bot player status is changing to idle and errors are emitted so both will trigger
you could open a pr to the repo
welp, I'm not familiar with ts sadly
in that case ig u could open an issue
are u connected in vc while running this command ??
Can you console log message.member ??
I am making a bot that when a user enters a channel it play a short clip. However the bot starts playing the clip before the user is actually connected to the channel and listening. Is there a way to make the bot wait until that user has fully connected?
Then your message is not an instance of discord.Message Class, So check your code properly
Try using setTimeout and delay the function of playing
A good workaround for now. Ty
To update the volume, I need to update on audio resource?
Like <AudioResource>.volume.setVolume ?
yes
Ty
Change this line
const channel = message.member?.voice.channel
TO
const channel = message.member.voice.channel
And then use this example only
Oh
Thanks NIP!
😄
anyone has a open saurce discord bot that works in stages?
Stage are just special voice channels , So everything you code for voice channel also works for stage channel. (Mostly)
I have a bot that works fine in vc but when I try to join him to stages he leaves
Do he leaves after joining ??
yeah second later
Show me joining command
This part mainly tells the bot that after join command is executed, Wait me to verify that I am totally connected to VC in 30 seconds. IF some errors come or bot fails to join in 30 seconds, It will throw error and disconnect from that VC
btw Thank you
djs version ??
any third party module to play music ??
12.5.3, I am using lava and erella to play
We only support native Voice API and can't give help for lava and erella
So ask their respective developers
oh ok do you know other way to get music from youtube?
youtube-sr for youtube searching and
ytdl-core-discord for playing music
do you know an open saurce project of it so i can learn it?
@heady jetty Use this as reference for new voice API
ok Thank you very much
👍
Did the old API use to automatically check for that?
Yeah and it was quite badly hardcoded with 15sec
So if it takes longer you couldnt do anything about it lol
Now you can
Yes New API is very flexible
thnx for the answer!
@steel crescent 1 request, can you lower slowmode timer ??
As these 2 channels( #archive-djs-v12-voice-deprecated #archive-voice ) don't have much traffic and having long cooldown of 15 seconds is of no sense.
Has anyone thought about writing a Lavalink-like yet or not?
yep 👀
Crawl said something about VoiceLink 👀
Oh nice 
🔔 v0.5.0 released -- https://github.com/discordjs/voice/releases/tag/v0.5.0 🔔
npm install @discordjs/voice@^0.5.0
nice
OwO new features are nice and helpful
@steel crescent See test(Secretbox): fix tweetnacl test Latest release only
Which will be faster ?? Creating connection and then disconnecting or destroying connection & for connecting to same vc, reconnecting or new connection
.addField(`**Number of songs in queue: ${queue.length} | Total Duration of queue: ${queue.duration}**`)
What is wrong in this? I am getting error field value must be non-empty string
they should both be as fast as each other, except that disconnect will keep the voice connection in memory
Anyone???
First of all this is not the channel to talk about embeds, ask in #archive-djs-v12-deprecated , Secondly embed's fields requires 2 things(one field name and second field value)
.addField(<field-name>, <field-value>)
Ah thank you
I don't think embeds are interactions btw 😂
LOL
i just downloaded ffmpeg from https://www.ffmpeg.org/download.html and i pressed, Download source code and it downloaded a zip file do i have to do anything or can i get coding ?
npm i ffmpeg-static
Hey, why does my bot stop playing music after some time randomly? Alone
https://imgur.com/WegrBWc I'm getting this error trying to run a bot on master that doesn't use anything voice related, I tried installing the package anyway but its still erroring
You need to enable skipLibCheck in the tsconfig file
is it something that will get changed or fixed in the future or do i just have to suppress it forever with skipLibCheck, because itd be nice not to have to use skipLibCheck if i dont have to
You could fix it by installing @discordjs/voice as a Dev dep
But besides that there is no other way to fix it than enabling skipLibCheck
True
Show me playSong function.
You can try to do this : https://github.com/discordjs/voice/issues/117#issuecomment-860081673
I'm I right woth the following assumption?
A bot can obly5be active on 1 audio channel per server?
If I want to relay some audio between multiples channel z I would need more than 1 bot/token?
Yes
One Bot can connect upto 1 voice channel per server
Yes, you will need more than 1 bot for relay some audio between multiple channels
But I don' know whether this is useful for you or not
You can play one music across all servers. (radio-bot)
const { getVoiceConnection } = require('@discordjs/voice');
const { MessageEmbed } = require('discord.js');
module.exports.run = async (bot, message, args, queue) => {
if (!message.member.voice.channel) return message.channel.send({ content: `What? Excuse me? Do you really expect me to execute a MUSIC command without you being in a voice channel? Like how you gonna use them if you can't hear them bruh? Big brain much?` });
if (queue === undefined) {
const connection = getVoiceConnection(message.guild.id)
connection.leave()
message.channel.send({
embeds: [new MessageEmbed()
.setDescription("Thanks for tuning in!")
.setColor("RED")
]
})
message.react("✅")
} else {
bot.distube.stop(message)
message.react("✅")
const connection = getVoiceConnection(message.guild.id)
connection.leave()
message.channel.send({
embeds: [new MessageEmbed()
.setDescription("Thanks for tuning in!")
.setColor("RED")
]
})
}
};
module.exports.config = {
name: "disconnect",
aliases: ['dc', 'DC', 'DISCONNECT']
}``` I don't want to use connection.destroy() So I tried using disconnect and leave but neither work.
type npm list @discordjs/voice
disconnect is added in v0.5.0
Oki
do I just do npm i @discordjs/voice
No, npm i @discordjs/voice@latest
Oki
BTW , your code is wrong , there is nothing like connection.leave()
https://discordjs.github.io/voice/classes/voiceconnection.html#disconnect
Lol okay XD
Hey, guys! Is voice receiver available rn?
It is in alpha stage, not completely ready for use
How does MEE6 use it?
Mee6 uses JDA and this is djs
Ohhh, got it
@hearty whale should be available by Monday 😁
Hey, why does my bot stop playing music after some time randomly? Alone
@subtle granite are you using the new voice library?
He is using old api
Can someone give me a information about new voice?
Pins
See pinned messages
Tnx^^
IDK what he wants to say
Check him in #archive-djs-v12-voice-deprecated
Yes
Using join command is not in New Voice API BTW
https://cdn.discordapp.com/attachments/222081003253006336/854979132554739782/unknown.png
You are also not using player
By new voice library I mean https://github.com/discordjs/voice, @subtle granite
it's a separate package, not the same as voice in discord.js v12
How to install and where ???
see pinned messages
its complicated
ye
very sad
sometimes i have a issue is that the music haven't reached the end but the bot stop playing & emit idle state. idk what to do to make it play the whole song proper
Code pls ?
welp where can i put my long code
Just show me playing command
if (message.content === '!play') {
const channel = message.member.voice.channel;
if (!channel) return message.reply('You must be in the voice channel.');
client.players.set(channel.guild.id, createAudioPlayer());
const player = client.players.get(channel.guild.id);
const info = await ytdl.getInfo('https://www.youtube.com/watch?v=x8VYWazR5mE');
const url = filter(info.formats)[0].url;
const resource = createAudioResource(url, { inputType: StreamType.Opus, });
console.log(url);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
player.play(resource);
connection.subscribe(player);
await message.reply('Playing now!');
player.once(AudioPlayerStatus.Idle, () => {
message.channel.send('finished playing!');
});
}
i played this song and met the problem. i did have this problem before with other songs but it become okay and idk y. then it's here again
Did you copy it from somewhere ??
i referenced the "hello world djs/voice ver" above and the filter function is also referenced somewhere this channel.
Can you show me filter function ??
yeah sure
function filter(format) {
var results = []
format.forEach((ele) => {
if(ele.codecs === 'opus' && ele.container === 'webm' && ele.audioSampleRate === '48000'){
results.push(ele)
}
})
return results
}
@mental patio can you try with the music bot example instead?
if the music bot example runs well for you then I'd recommend using youtube-dl
Just ban any mention of ytdl-core
Tbh
Maybe we should add a tag for it
You need to add some lines before creating a source
const FFMPEG_OPUS_ARGUMENTS = ['-analyzeduration','0','-loglevel','0','acodec','libopus','-f','opus','-ar','48000','-ac','2'];
const stream = new prism_media.FFmpeg({
args : ['-reconnect', '1', '-reconnect_streamed', '1', '-reconnect_delay_max', '5','-i', url, ...FFMPEG_OPUS_ARGUMENTS ]
})
var source = createAudioResource(stream, { inputType: StreamType.OggOpus , inlineVolume : true })
Try this
He is not even using ytdl-core to stream, Why you hate ytdl-core soo much ??
Because it’s trash
Not completely
Yeah completely
For discord bots it's not good
Anyway for this specific case,
But it is good for extracting urls
yes that is fine
But I'm still not sure why you would rather use FFmpeg over YouTube-dl here
youtube-dl gives better performance and you don't have to worry about reconnect arguments
I would prefer if we pushed people to use youtube-dl over ffmpeg for this reason
it's simpler and faster
Because it uses more resources than FFmpeg in all platforms
For music-bot, resources matter a lot
🤔
It uses less
youtube-dl in our music bot example only streams the audio file
Ffmpeg has to both stream it and transcode it
wait whats the prism_media
do i have to require or import anything to use it
You need to import that
and its state now change to idle instantly
did i use the wrong package? since i guess it's prism-media
What is your url ??
Import prism media by this code const prism_media = require('prism-media')
i install this https://www.npmjs.com/package/prism-media
yes
yeah it now emit the idle instantly. did do anything wrong with the code?
const player = client.players.get(channel.guild.id);
const url = filter(info.formats)[0].url;
const FFMPEG_OPUS_ARGUMENTS = ['-analyzeduration','0','-loglevel','0','acodec','libopus','-f','opus','-ar','48000','-ac','2'];
const stream = new prism.FFmpeg({
args : ['-reconnect', '1', '-reconnect_streamed', '1', '-reconnect_delay_max', '5','-i', url, ...FFMPEG_OPUS_ARGUMENTS ]
});
const resource = createAudioResource(stream, { inputType: StreamType.OggOpus , inlineVolume : true });
console.log(url);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
player.play(resource);
connection.subscribe(player);
await message.reply('Playing now!');
this is the part i changed
@lime gale I'll take a look at your PR in a bit, honestly I'm not against just using as any here but I'm trying to find a nicer way
seems like something the typescript compiler should be happy with to me so I'm a bit confused why it's not
Any bad
Me too, but my solution without as any is quite long and it's not good for further maintain
crawl grace us with your typescript knowledge on that PR 😩
When discord gives me voice gw without needing the main gw
so never?

Where did you imported prism-media ??
beginning of my code
const ytdl = require('ytdl-core-discord');
const { joinVoiceChannel, createAudioResource, createAudioPlayer, StreamType, AudioPlayerStatus } = require('@discordjs/voice');
const { Client, Intents, MessageEmbed } = require('discord.js');
const prism = require('prism-media');
any errors in console ??
no errors
Did you get url in console ??
yeah the url is logged proper
Do you have any test server ??
I want to see it
yeah i have
can i dm u?
DM me
k
@vocal valley What will happen if we have wrong adapterCreator ?? Do it emits errors ?
I know that if we have nothing, then it will emit errors, but what about wrong function ??
if the function is incorrect, it depends on how incorrect the function is
E.g. if it is very incorrect, bot may not connect at all
If partially incorrect, bot could get disconnected incorrectly
Just look at this code
Is there anything wrong ??
Full Code :
if (message.content === '!play') {
const channel = message.member.voice.channel;
if (!channel) return message.reply('You must be in the voice channel.');
client.players.set(channel.guild.id, createAudioPlayer());
const player = client.players.get(channel.guild.id);
const info = await ytdl.getInfo('https://www.youtube.com/watch?v=x8VYWazR5mE');
const url = filter(info.formats)[0].url;
const FFMPEG_OPUS_ARGUMENTS = ['-analyzeduration','0','-loglevel','0','acodec','libopus','-f','opus','-ar','48000','-ac','2'];
const stream = new prism.FFmpeg({
args : ['-reconnect', '1', '-reconnect_streamed', '1', '-reconnect_delay_max', '5','-i', url, ...FFMPEG_OPUS_ARGUMENTS ]
});
var resource = createAudioResource(stream, { inputType: StreamType.OggOpus , inlineVolume : true })
console.log(url);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
player.play(resource);
connection.subscribe(player);
await message.reply('Playing now!');
player.once(AudioPlayerStatus.Idle, () => {
message.channel.send('finished playing!');
});
}
@vocal valley In this, bot connects and tries to play a song but is unable to do so and no errors in console either
As per my predictions, joining command has some fault, everything works as it is supposed to be
First I would appreciate if @mental patio would try to see if the music bot example works first
Been using the example from the repo, nothing error related so far, well except for the intraction failed on onfinish since past 15min from interaction.defer()
Ah yeah
I have not update to the latest 0.5 version with disconnect?
I shared my repo before too, which basically just a converted example of the typescript to javascript
That should be fine, it doesn't really affect the music bot I don't think
You don't need to pipe Pass through
Leave that part and try again
ffmpeg version ??
change args and then try again :
const args = ['-reconnect', '1', '-reconnect_streamed', '1', '-reconnect_delay_max', '5','-i', url, ...FFMPEG_OPUS_ARGUMENTS ]
What I did before when it join and then no voice is change the stream type. StreamType.Opus, other type doesn't seem to be voicing out, and horrible on raw
is your url audio endpoint ??
Show me code after these lines
Whole playing code
When did you created the audio player, as far as I can see you are just playing music at start of bot ??
Without creating a audio player 
Shhhh;(
Worked ??
Is there any context to the error TypeError: secretbox.methods.close is not a function? Figured out that it gets generated from the AudioPlayer.play method. Is there any general guides for me to follow with this issue?
I'd assume the resource isn't valid, as that might be the case. How does one create an audio resource from disk?
npm i libsodium-wrappers
Ty, thought all peer deps were installed. my bad
hey i am making a music bot ....so any body can give me public lavalink
pls
I did one more research on topic (FFMPEG vs YouTube-DL) and Why I prefer FFMPEG over YouTube-DL ??
https://github.com/discordjs/voice/discussions/134
@vocal valley Just make sure to check this out once you are free.
left my reply
I agree with your points
👍
ty for putting together a comparison
👍
Which ??
You got your problem fixed right ??
Show me code now
Code ??
yes sure
Hi there, I am trying to make a new channel and lock it to specific roles and get the ID of the channel
this is my code so far
message.guild.channels.create(name + "'s group", {
type: 'voice'
})
.then((channel) => {
channel.setParent(categoryID)
channel.setUserLimit(5)
//nelow does not work
var channelId = "" channel.guild.channels.cache.get(channelId)
console.log(channelId)
})```
Anyone know how to do this?
what has that to do with voice?
its a voice channel?
that doesn't really matter
this and #archive-djs-v12-voice-deprecated are for voice related activities
sending and receiving audio
not voice "channels"
oohhh
my bad
Does the audio player automatically get destroyed when it goes to idle or do I have to do it myself?
No, audio player can be reused even after it has reached idle state, You have to manually delete the player.
how can i play a playlist
Use youtube-sr for that
okay thx
but what is better? youtube-sr or ytpl
Youtube-sr is faster
okay thx
Sorry if I can't ask this here, but is the voicelink in the discord.js github an example?
VoiceLink or LavaLink ??
voicelink, discordjs/voicelink on github
It is under-development, not ready to use
I'm trying to learn about new voice library with the basic example
but when i'm trying to run tsc i got this error RangeError: Maximum call stack size exceeded
any help?
Try starting bot with npm start
wth
tsc only compiles ts file
litterally what i'm doing
Ok, then I don't know about your error
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
selfDeaf: false,
selfMute: true,
adapterCreator: channel.guild.voiceAdapterCreator,
});
While the bot is selfMute, why can it play sounds in my server?
It can not
// => TypeError: adapterCreator is not a function
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
selfDeaf: true,
});
``` It works on my development environment but not on my server?
what version? update to latest version 0.5.0
I am already using this version
const Discord = require('discord.js')
const { VoiceConnectionStatus, entersState, joinVoiceChannel } = require('@discordjs/voice')
module.exports.run = async (bot, message, args) => {
if (!message.member.voice.channel) return message.channel.send({ content: `What? Excuse me? Do you really expect me to execute a MUSIC command without you being in a voice channel? Like how you gonna use them if you can't hear them bruh? Big brain much?` });
const music = args.join(" ");
bot.distube.play(message, music)
if (VoiceConnectionStatus.Ready) {
if (message.member.voice.channel instanceof Discord.StageChannel) {
message.member.guild.me.voice.setSuppressed(false);
}
} else {
const connection = joinVoiceChannel({
channelId: message.channel.id,
guildId: message.member.guild.id,
adapterCreator: message.member.guild.voiceAdapterCreator,
})
await entersState(connection, VoiceConnectionStatus.Connecting, 15000);
}
}
module.exports.config = {
name: "play",
aliases: ['p', 'P', 'PLAY']
}```VoiceConnectionStatus.Ready doesn't work for me. it doesn't join channel but it says ready
try run npm ls @discordjs/voice and see what version
npm ls @discordjs/voice
my-project@1.7.2 /home/my-project
`-- @discordjs/voice@0.5.0
The problem is it works on my local machine with windows. But when I run my bot on linux I get this error: TypeError: adapterCreator is not a function
not working on different machines sounds like different versions
at new VoiceConnection (/home/my-project/node_modules/@discordjs/voice/dist/VoiceConnection.js:74:25)
at Object.createVoiceConnection (/home/my-project/node_modules/@discordjs/voice/dist/VoiceConnection.js:475:29)
at joinVoiceChannel (/home/my-project/node_modules/@discordjs/voice/dist/joinVoiceChannel.js:17:30
different versions of what? I already have the latest @discordjs/voice version
of that yeah, if not different versions then I don't know
The package.json is exactly the same
ffmpeg and all dependencies installed
Check node and npm versions too. I had the same problem.
v14.17.1
➜ ~ npm -v
6.14.13```
Am I using wrong versions?
Update your npm using npm i -g npm@latest
On both machines
Now it works, the bot joins the voice channel but does only play silence
Now that is up to you to figure out with your code
No, it works on my windows machine
on the linux, have you installed all the necessary dependant? FFMpeg, ptyhon 2.7
ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6)
python?
and what lib you using youtube-dl?
Python 2.7.16
I dont use any lib. I play a stream url via ffmpeg -i
const attachRecorder = () => {
player.play(
createAudioResource(
new prism.FFmpeg({
args: [
'-analyzeduration',
'0',
'-loglevel',
'0',
'-reconnect',
'1',
'-reconnect_streamed',
'1',
'-reconnect_on_network_error',
'1',
'-reconnect_on_http_error',
'4xx,5xx',
'-reconnect_delay_max',
'30',
'-i',
streamURL,
'-acodec',
'libopus',
'-f',
'opus',
'-ar',
'48000',
'-ac',
'2',
'-af',
'bass=g=4',
],
}),
{ inputType: StreamType.OggOpus },
),
);
};
``` Which works fine on windows
Try typing this in linux npm i discord.js@dev@latest
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2), this is my ffmpeg version on my ubuntu, try update the ffmpeg maybe? Or change the StreamType
Do he have issue with adapter Creator ??
solved, but no sound
yes
I will try to update my ffmpeg now if there is a newer version
What is your current issue ??
The bot joins, but does only play silence
You have some args issue, not an ffmpeg version issue
Which args are wrong then? Because it works on my windows machine
@subtle granite
const FFMPEG_OPUS_ARGUMENTS = [
'-analyzeduration',
'0',
'-loglevel',
'0',
'-acodec',
'libopus',
'-f',
'opus',
'-ar',
'48000',
'-ac',
'2',
];
player.play(
createAudioResource(new prism_media.FFmpeg({
args : ['-reconnect', '1', '-reconnect_streamed', '1', '-reconnect_delay_max', '5','-i', url, ...FFMPEG_OPUS_ARGUMENTS ]
}), { inputType: StreamType.OggOpus }))
Try doing this
give me a sec I will try this
how to make a music bot, as i have never ever made music bots, any idea or video tutorial i would preffer docs
?music
Watch the in-depth YouTube series on how to make a music bot right here:
https://www.youtube.com/playlist?list=PLVzaElkTvlQae8XJ0ujnEgz1GviufNx8h
Additionally there is https://github.com/iCrawl/discord-music-bot
woah thank u ❤️
The example repo seem using the old v12
This is working as expected - selfMute and selfDeaf are client-side only, they're not enforced by Discord's server, in fact, your bot receives voice packets even if selfMute is true.
It worked. You're a magician man. But what argument was wrong?
yes, he is new, so let him know easier way first
Thanks ❤️
@vocal valley Just asking, IS this discord problem or discord voice problem ??
How do I use getVoiceConnection ? It always returns null
If bot is not connected to vc , then connection will be null
But it is connected
Code then pls
I use the same as in the radio bot example and the try to use getVoiceConnection(guildId) but it returns null even when it is connected
@carmine timber
Radio-bot example has nothing like getVoiceConnection, show me your code
How can I make the bot join my voice channel when I make a command?
New to music bot , then type ?music in this channel
It's not for a music bot, I do voice recognition... But I managed to make it join the vc, now the bot just doesn't understand the guildMemberSpeaking event...
VoiceReciever will be ready by Monday, so wait till then
Okay nice
Is there any nodejs version of this example music bot?
https://github.com/discordjs/voice/tree/main/examples/music-bot
Oh, how can I implement it then?
Where did you add getVoiceConnection ??
Because it was in the docs marked as export, I thought it can be used
Are you using this ?? https://github.com/discordjs/voice/blob/main/examples/radio-bot/index.js
Yes
Show me where is getVoiceConnection in there ?? Line no. ??
Its not there but in the documentation page it is as a method
And why can it be imported from the module then?
I know that . Show me your code.
If it has no use
As said its the same
If it is same then show me where is getVoiceConnection here : https://github.com/discordjs/voice/blob/main/examples/radio-bot/index.js
Don't tell me that it is a method and I used it
I want to see the code
?
No, you have to manually convert it Or use docs in pins
I did not say it is in the example. I said it is shown in the documentation of the module and it can also be imported from there, so I assumed it could be used. But it seems this is not the case
Yes you can use it, But a proper connection is required before using that
@vocal valley I hope you read this.
I would say that it's a bit of both?
We can alter voice to not play to vc's that are self muted
But at the same time discord really shouldn't allow us to do so
Yes
I don’t think we should stop playback when we self mute
Because it would act like a pause then, you might not want to pause
And just not sending packets but continuing the playback seems like a major hack
How do I do that? In the example a connection is established, but when I use the getVoiceConnection it returns null
Do I have to store it somewhere?
?music
Watch the in-depth YouTube series on how to make a music bot right here:
https://www.youtube.com/playlist?list=PLVzaElkTvlQae8XJ0ujnEgz1GviufNx8h
Additionally there is https://github.com/iCrawl/discord-music-bot
@empty torrent that got nothing to do with my question and nothing to do with the new voice module
I did not mention you
How can i install the dev branch of discord js which includes adapterCreator function?
I’m getting TypeError: adapterCreator is not a function
I have tried 13.0.0-dev.02693bc02f45980d8165820a103220f0027b96b7 and reran npm i but didn’t seem to help
Using ubuntu
npm i @discordjs/voice@latest, also get some decent understanding of js first. Saw you asking on Programming Hangout server as well
Thank you. I’m trying
How to join a vc? message.member.voice.channel.join() no longer works..
can someone help?
It does...
Show me code where you used getVoiceConnection,
For more understanding, see https://deploy-preview-595--discordjs-guide.netlify.app/voice/voice-connections.html#access
did something break with an update?
const connection = joinVoiceChannel({
channelId: interaction.member.voice.channel.id,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator
});
this doesn't work anymore, i get the error message TypeError: adapterCreator is not a function
this is on version 0.5.0
(update) using the github version of discordjs works fine, guess its just a bug with the one on npm then
No it is not a bug of NPM, I have latest version and there is no issues like that.
Try to remove it by npm uninstall @discordjs/voice
and then re-install with npm i @discordjs/voice@latest
i did that, didn't work, what did work was installing the github version of discordjs
and @latest installs the same exact version, 0.5.0
can you read what i said? the problem was in discord.js itself, not the voice module
👍

is the djs version 13 since i think voiceAdapterCreator is added in v13
version 13 isn't out yet, but the beta on npm npm i discord.js@dev seems to be broken right now, using the more updated github version npm i discordjs/discord.js doesn't produce this error
you mean the npm i discord.js@dev didnt download the beta v13 now
i can sure few days ago this is okay but idk what happens now too
yeah i had an earlier one, i updated it today and it broke
so now im using the github one until the npm one gets updated
i dont think this is a voice lib question anymore perhaps you can ask #djs-help-v14
or did you uninstall and install again?
there are no more issues, i fixed it 👍
Is it only available for the shard the connection was created in? Because then it would be my mistake
Do you know if it's easy to mix multiple audio sources? we're looking to use a nodejs app4that would relay some live audio communications trought DiscordJS.
I know it's not a core feature of DJS but does anyone know some library that could help with this topic?
yes, it is mistake from your side
Maybe this could help you : https://www.npmjs.com/package/audio-mixer
Is there any way to use it amongst multiple shards? So to get a specific connection by the guild id, not knowing which shard it is on?
ask hydrabolt about this
you always know which shard a guild is on
Does this new Voice Module automatically check for permissions to speak?
Nop
Okay. Could you give an example how to use getVoiceConnection with this then?
does the new voice update only affect playing sounds in voice channels? like will voiceStateUpdate work as it did before as well as moving users between voice channels?
(currently i'm running an accountability bot in v12 that tracks user minutes in a few specific voice channels)
I keep getting ```js
Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
whenever I use `<AudioPlayer>.stop()`
also, it started happening from today (never happened before)

nevermind I think I fixed it
V13 doesn’t have voice module anymore
Read the pins
I tried to connect to a voice channel by doing
const connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator,
});
and i get the error adapterCreator is not a function
This only happened after i updated the voice api from when i installed it yesterday. Any idea as to why?
You need to update to the latest dev version
Uninstall discord.js@dev and reinstall it
ok
Can you use @discordjs/voice in djs v12?
No
Well, prob could
Wym prob?
It hasn’t been tested and isn’t an intended feature
Hmm alr
In theory, it would work since the package is independent
Alr
It should work @serene dawn, the basic example we have works with v12
to get /voice to work with v12, you just need to use the adapter file included in the basic example
Link, also could you change my nickname to Sky please
Is it this one? https://github.com/discordjs/voice/tree/main/examples
Yep
The basic example there
Alr ty, i see it
If you're using JavaScript and don't want to compile the typescript adapter file, you can use this file instead:
https://github.com/amishshah/discord-radio-bot/blob/feat/upgrade/src/adapter/adapter.js
^ that's just the compiled version of the typescript file
Should i just copy that file and have it run through my index?
Oh i c, im just blind
np
module.exports = {
name: 'play',
description: 'play',
async execute(message, args) {
message.member.voice.channel.join()
const connection =await message.member.voice.channel.join();
connection.play('commands\Delax - Drop You Like.mp3');
},
};
doesn't output any sound
@knotty frost please read the channel topic and pins before blindly posting code here and saying it doesn't work
your code is not related to the new voice library, you are looking for #archive-djs-v12-voice-deprecated
k sorry
expanded the Track class from the original example to Soundcloud as well now, though I not very sure the youtube-dl options need adjustment or not
how big is the inlineVolume impact on performance? Against 2 vcore vps
I think the voicelink repo would be good to look at for this, the open PR adds support for all the sources YouTube dl works with
I don't have any benchmarks so I'd suggest trying it out and seeing how it performs
I have no method or any idea how to benchmark either. process.cpuUsage? or something like that?
cpuUsage will definitely be higher but im not sure by what quantity, so measuring that could be useful
but another thing to measure would be how smooth the playback is.
this is pretty easy to do qualitatively, but at some point in the future im planning on doing a quantitative measurement on this
and also considering some improvements that have big performance improvements for streams that have inline volume enabled
sound like a plan
Is there a way to see when an audio source has finished playing?
const channel = msg.member.voice.channel;
const connection = await channel.join();
TypeError: channel.join is not a function
Joining channels has changed. You can look at https://deploy-preview-595--discordjs-guide.netlify.app/voice/voice-connections.html#cheat-sheet to see how to join a channel.
thanks
@loud breach how can i play ?
TypeError: connection.play is not a function
You need a audio player
The docs again will help you
https://deploy-preview-595--discordjs-guide.netlify.app/voice/audio-player.html#cheat-sheet
I recommend you read that
ok thanks
just bumping this
Check the AudioPlayerStatus , If the Idle state is entered from a non-Idle state, it means that an audio resource has finished playing.
Well i do that
But sometimes it triggers even tho the video hasn't finished playing
Thats why im asking. Like is there a .on('finish') function?
Is there a way to adjust the quality?
At the moment the audio sounds like the old voice-implementation, which is a bit different than the file itself.
For example the discord-leave sound. It's completely different if it is played in a voice channel through the bot.
AudioResource is set via
resource = createAudioResource(fs.createReadStream(filePath), {inputType: StreamType.OggOpus});
is there a way to disconnect client from a channel without using voiceConnection because i want to disconnect my bots user from a channel but the bot is crashed so there is no voiceConnection available
const { getVoiceConnection } = require('@discordjs/voice');
const connection = getVoiceConnection(myVoiceChannel.guild.id);
i found this on docs
oh let me try didnt know that method
How can I get a voice connection with sharding by only having the guildId?
const DiscordVoice = require('@discordjs/voice');
DiscordVoice.joinVoiceChannel({ adapterCreator: Interaction.guild.voiceAdapterCreator, channelId: MemberVoiceChannel.id, guilId: Interaction.guildID, selfDeaf: false, selfMute: false });
The client just dont joins the voice channel; The ids are right but it does nothing.... Can someone help me?
Never mind, forgot the d at guild...
if (!message.guild) return;
if (!client.application.owner) await client.application.fetch();
if (message.content.toLowerCase() === '!deploy' && message.author.id === client.application.owner.id) {```
TypeError: Cannot read property 'application' of undefined
First this isnt related with new voice library second message event doesnt give you client so the client var will be undefined and you cant acsess all the properties of a client object
ps: i think you tried to copy music-bot example which is somewhat related but as i mentioned you dont need to use client paramater on this event listener because i am assuming by looking at how you listen to events you already have a client variable so by removing client paramater it should fix your issue
You actually forgot a ? before .owner
Trying to convert it to js
Can you screen record the issue? 👀
And also maybe send the audio files
Isn’t that expected?
Voice channels don’t have a high enough Bitrate
well the bitrate thing is more of a client side thing
bots don't have to respect the bitrate of the channel
well they should respect it, but there is nothing stopping bots from picking any bitrate they want
is it necessary to use discordjs@voice in v13 djs?
Yes
😭
im questioning if i shall re write my bot to v13
File on the server:
how it is played in voice chat
@junior glen out of interest, are you playing it as an ogg/opus file? or as an arbitrary input
ogg/opus. I tried a lot but nothing changed
- as mp3 and no type
- with higher bitrate
- with highWatermark at 50
always the same result
hmm interesting, i'll take a look later today
my guess is that the Ogg file has a volume adjustment that is not being respected
also tried a mp3 file
could you try an mp3 file with inlineVolume: true?
same result
do you need the result/recording?
any guide or docs for new djs voice?
nope that's fine, will have a look and see
Is the music example what it's gonna be or is it gonna get updated?
music example is basically complete
there will also be a voicelink repo https://github.com/discordjs/voicelink/pull/1 similar to lavalink
thanks
what would be diffrent from voice repo
There isn't any error in console. Bot is joining to vc but it isn't playing any song. Ytdl or ytsr isn't returning undefined or null, they are returning the data that they suppose to return.
What is the problem?
// msg = message class
// client = client class
// args is coming from command handler which parses every arguement.
// ytsr is a function coming from ytsr module for yt video search
// ytdl is a function comfing from discord-ytdl-core module for downloading videos from yt
let requestedSong = args.join(' ');
if (!requestedSong) return msg.reply('Invalid song specified!');
const connection = await joinVoiceChannel({ channelId: msg.member.voice.channel.id, guildId: msg.guild.id, selfDeaf: true, adapterCreator: msg.guild.voiceAdapterCreator });
const subscription = connection.subscribe(player);
const searchResult = (await ytsr(requestedSong, { pages: 1, limit: 1 })).items[0] || null;
if (!searchResult) return msg.reply('Song not found on youtube.');
subscription.player.play({ audioPlayer: subscription.player, playStream: await ytdl(searchResult.url, { filter: 'audioonly'}) });
My music commands for my bot just died out due to new updates and hence i'm looking for a new solution to playing music with my bot that is not to hard.. any suggestions?
same problem here you have to use the new music module since v13 does not support built in music functions
How can I set the volume of the <AudioPlayer>?
How can I let my bot join to any voice channel in new voice lib ?
Check out this function: https://discordjs.github.io/voice/modules.html#joinvoicechannel
throw er; // Unhandled 'error' event
^
AudioPlayerError: aborted
at connResetException (node:internal/errors:683:14)
at TLSSocket.socketCloseListener (node:_http_client:407:19)
at TLSSocket.emit (node:events:406:35)
at node:net:661:12
at TCP.done (node:_tls_wrap:580:7)
Emitted 'error' event on AudioPlayer instance at:
at WebmDemuxer.onStreamError (/workspace/node_modules/@discordjs/voice/dist/audio/AudioPlayer.js:213:22)
at Object.onceWrapper (node:events:514:26)
at WebmDemuxer.emit (node:events:406:35)
at emitErrorNT (node:internal/streams/destroy:193:8)
at emitErrorCloseNT (node:internal/streams/destroy:158:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {```
why this crash!
^using ytdl-core?
no ytdl discord core
well, it is from the dependacy of ytdl-core, ytdl-discord-core still use ytdl
ya i know so its a ytdl error?
yes
is youtube-dl stable?
I'm using youtube-dl, the example uses youtube-dl, so far no issue
Hey I'm making a radio bot, and I don't understand this package, like I wanna play a livestream from youtube and distribute to every channel bot joins, but I'm confused how to do it, in v12 I could do it by creating a broadcast, and I need to do this because I wanna add stage channel support too
entersState(target: VoiceConnection, status: VoiceConnectionStatus, maxTime: number) here what maxtime means ?
Like for connecting or staying on the voice channel ?
^ like delay before the connection to voice channel is stable
you can create a single audio resource and single audio player, play that resource on the player, then connection.subscribe(player) for all connections you want to share the resource
what should be the good value for it ?
I appreciate that, but if you have any examples that will be very helpful. I'm not used to discord.js voice stuff
there are 3 examples in the repo, the radio-bot is probably helpful
since that is one audio stream across many voice connections
can you tell bro ? what should be the good valeu for maxtime ?
15 or 20 seconds is good i think
btw hydrabolt,suggestion to make the description of maxState in milisecond(s)
noted, ty
ok should I write in miliseconds ?
yes

Wait how would that thing will play there is no options for passing any stream link
or any url
guys i wanna code a music bot for discord but what the packages or files i need? like do i need to download what this guy does ? :https://www.youtube.com/watch?v=51qijrpTvyE
also look at the music bot example
or the basic example
ok
do i need to download the thing he does or can i just code it ?
https://deploy-preview-595--discordjs-guide.netlify.app/voice/#barebones you can refer to the Extra dependacies section
ok thx
Can I change the Volume of a Song while playing? And if yes, how can i do it?
I didn't found something in the examples...
const resource = createAudioResource('path.mp3', { inlineVolume: true });
resource.volume.setVolume(0.5);
It looks like CreateAudioResourceOptions does not appear on the docs 
So easy? Well thank you
How to make bot speaker when he joins the stage channel ?
(That's something for #djs-help-v14 btw, as this channel is for @discordjs/voice))
oo sorry I though its changed
events.js:292
throw er; // Unhandled 'error' event
^
AudioPlayerError: Video unavailable
hey, I wanted to know does this require node v14 like djs v13?
Yes
Need a Person who can design the UI for my application DM me
Not the correct channel for this
ok
@steep sedge This don't belong in this Channel. Use #archive-djs-v12-voice-deprecated instead
ok
Sorry it took me so long to get back to you, I had to tweak lots of things to see if I am still able to replicate. The issue appears to only happen when receiving audio from someone on the Chrome browser.
This is the error I get:
Segmentation fault (core dumped)
exit status 139
And it completely crashes the bot. Doesn't just crash the command. It crashes the whole bot.
is there documentation coming for @discordjs/voice? I have a bot that plays a livestream from youtube in all voice channels its connected to, but I'm having a lot of trouble making it compatible with v13 in javascript.
There are docs: https://discordjs.github.io/voice/modules.html
Since you might end up looking at prism-media stuff too: https://amishshah.github.io/prism-media/
this is too confusing but i also want to upgrade to v13 so ig i'll kill the music bot
that's odd, what opus library are you using
I believe I'm just using opusscript 
could you try @discordjs/opus
I am fairly certain this is fixed in the new voice library
Actually, I think I'm using @discordjs/opus
but voice receive is still a little unpleasant to use in the new voice library, I made a PR to improve it but it's still WIP
oh interesting 👀
Yeah I lied, I'm not using opusscript. I'm using discordjs/opus
👍
I'm assuming maybe some faulty receiving code is passing bad Opus packets to the discordjsopus library
causing a segfault
I guess for now, you'll just have to wait for https://github.com/discordjs/voice/pull/136 to be merged
This is a little bit of my code if it helps.
// this creates a 16-bit signed PCM, stereo 48KHz stream
const audioStream = voice_Connection.receiver.createStream(user, { mode: 'pcm' })
audioStream.on('error', (e) => {
console.log('audioStream: ' + e)
});
let buffer = [];
audioStream.on('data', (data) => {
buffer.push(data)
})
audioStream.on('end', async () => {
buffer = Buffer.concat(buffer)
const duration = buffer.length / 48000 / 4;
console.log("duration: " + duration)
if (duration < 1.0 || duration > 19) { // 20 seconds max dur
console.log("TOO SHORT / TOO LONG; SKPPING")
return;
}
try {
let new_buffer = await convert_audio(buffer)
let out = await transcribe(new_buffer);
if (out != null)
process_commands_query(out, mapKey, user);
} catch (e) {
console.log('tmpraw rename: ' + e)
}
and then you can actually use voice receive in the new library without hating it lol
Alright lol
Actually, could you try this out
That might fix your issue
I'll try that and let you know 
Okay, some improvement. It still crashed the bot, but now I have a more detailed error about what the problem is.
Okay wait wtf
👀

First it got this:
21:28:23: FATAL ERROR: Error::ThrowAsJavaScriptException napi_throw
21:28:23: 1: 0xa89e60 node::Abort() [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 2: 0x9ade29 node::FatalError(char const*, char const*) [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 3: 0x9ade32 [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 4: 0xa55b3b napi_fatal_error [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 5: 0x7fa2a867cc8e [/home/dzlandis/Discord-Scriptly-Free/node_modules/@discordjs/opus/prebuild/node-v88-napi-v3-linux-x64-glibc-2.31/opus.node]
21:28:23: 6: 0x7fa2a867d3ec Napi::Error::ThrowAsJavaScriptException() const [/home/dzlandis/Discord-Scriptly-Free/node_modules/@discordjs/opus/prebuild/node-v88-napi-v3-linux-x64-glibc-2.31/opus.node]
21:28:23: 7: 0x7fa2a8689d68 OpusEncoder::Decode(Napi::CallbackInfo const&) [/home/dzlandis/Discord-Scriptly-Free/node_modules/@discordjs/opus/prebuild/node-v88-napi-v3-linux-x64-glibc-2.31/opus.node]
21:28:23: 8: 0x7fa2a86802da Napi::InstanceWrap<OpusEncoder>::InstanceMethodCallbackWrapper(napi_env__*, napi_callback_info__*) [/home/dzlandis/Discord-Scriptly-Free/node_modules/@discordjs/opus/prebuild/node-v88-napi-v3-linux-x64-glibc-2.31/opus.node]
21:28:23: 9: 0xa390bf [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 10: 0xce224b [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 11: 0xce37fc [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 12: 0xce3e76 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node /home/dzlandis/Discord-Scriptly-Free/index.js]
21:28:23: 13: 0x15046d9 [node /home/dzlandis/Discord-Scriptly-Free/index.js]
But then it restarted and now it's working perfectly and transcribing the user on Chrome 

yea I have no clue
That's uhhh odd
I mean, I guess it is working now? So thanks??!!?!?
Maybe it hadn't got the change the first time around
np hahaha, thanks to the person who made the fix in the first place
Well, before it would just through a segmentation fault. I had never seen that error before.
Well yeah, thanks again lmao
Np 👍
yo i need help
So like, if I do an update to discordjs or something, will it erase that change though?
what are the packages that need to be installed before coding a discord music bot ?
I'd recommend following a Discord Music Bot tutorial. They should prompt you through the steps.
which one do u think is better to follow
yeaaah, if you aren't quite ready to upgrade to v13 and the new voice library, I'd recommend forking the stable branch, committing that change, and then using that fork instead of the version on npm
@subtle granite this is not relevant to the new voice channel
ah ok but if get an error in the code can i come here ?
if you get errors you should still use that channel, this channel is for people using @discordjs/voice which is a new library
OHHH ok thanks
Np
errored: Error: connect ETIMEDOUT
how can i fix that
I've never messed with typescript - I'm a little confused on how I would use the examples for new voice in a JS project...
does the new voice lib have typings included?
its coded in ts so yes
f
I'm trying to be a good noodle and use new voice considering I'm using v13 but I hit a stumbling block pretty early on - Error: Cannot find module 'Z:\dory\node_modules\@discordjs\voice\dist\index.js'. Please verify that the package.json has a valid "main" entry
getting that whenever I try to start the bot. check node_modules and as I expected, the dist directory doesn't even exist. I have the dependencies I need (tweetnacl, ffmpeg-static and discordjs/opus - I just want to play a single audio file)
am I missing something obvious?
how did you install it
it has a dist directory on npm https://cdn.jsdelivr.net/npm/@discordjs/voice/
did you download it from github maybe?
ermmm I installed via npm i discordjs/voice
just installed using npm i @discordjs/voice as per https://www.npmjs.com/package/@discordjs/voice and I still get the same error on startup with the dist dir still missing
yeah this sounds like the problem
read my follow up
yeah i saw it, but it probably didnt update properly
can you try fully uninstalling it and then reinstalling it
mhmmm, 2 secs
ok, that worked. I did uninstall and then install and it made no difference. for some reason I had to refresh the node_modules folder in VS code first. ty for your help
@woeful shuttle turn on skipLibCheck in tsconfig
How can i check voice connections size?
Are there any js implementation of YouTube-dl instead of ts?
Converting the TS to JS code is simpler than you think
Having a JS example would just duplicate the code
I did but it doesn't play and doesn't throw any error
That has nothing to do with TS or JS then lol
Also kinda hard to debug if it does “nothing”
I know but just to be sure
You gotta do some digging
Check the docs for debug events n stuff
See if they emit something
Ok thanks
how to subscribe a specfic live stream in youtube for every player ?
like I tested radio bot example , but doesn't help
How can i get the stream time with this new package? The old was <Dispatcher>.streamTime but this does no longer exist in the new package or I dont found it..
what is Error: write EPIPE?
ytdl-core works
hydrabolt , told yesterday that there is some function related to it in new voice lib
TypeError: adapterCreator is not a function is coming when i try to join to a channel
Error
at new VoiceConnection (/home/container/node_modules/@discordjs/voice/dist/VoiceConnection.js:74:25)
at Object.createVoiceConnection (/home/container/node_modules/@discordjs/voice/dist/VoiceConnection.js:475:29)
at joinVoiceChannel (/home/container/node_modules/@discordjs/voice/dist/joinVoiceChannel.js:17:30)
at Join_Voice (/home/container/events/Music_Player_events/Voice_Main_events/Music_Manager.js:65:34)
at Auto_Join_Voice_Music_Player (/home/container/events/Music_Player_events/Music_Player_Voice_events/Auto_Voice_Connection.js:10:110)
at Voice_Checker (/home/container/index.js:376:34)
at Client.<anonymous> (/home/container/index.js:368:2)
at Client.emit (events.js:388:22)
at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:377:17)
at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:361:10)```
Update discord.js
is ytdl-core or other sub modules of ytdl-core compatible with this library
Yeah but not encouraged because of the problems when it comes to streaming audio with them
hmm then which library do you recommend for downloading youtube videos
Like we use in our examples
youtube-dl
but i think we can't change the encoding of the video in that module right?
Sure can
It can download the version you want
Just like the others
oh, thats cool thanks!
How do i get the voice connections size?
how can my bot play music in a stage channel?
read the pins
Anyone?
Thank you, and do you know about the paused time?
that was removed from d.js in v13 you use the joinVoiceChannel method that is provided from the @discord.js/voice module
@onyx bough ^ there is also examples how to use the new voice library in the pins
I get an error while using the audio player:
Error:
AudioPlayerError: Status code: 404
at ClientRequest.<anonymous> (/home/disgroup/DisBot/node_modules/miniget/dist/index.js:210:27)
at Object.onceWrapper (events.js:483:26)
at ClientRequest.emit (events.js:376:20)
at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at TLSSocket.socketOnData (_http_client.js:515:22)
at TLSSocket.emit (events.js:376:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at TLSSocket.Readable.push (internal/streams/readable.js:223:10)
Emitted 'error' event on AudioPlayer instance at:
at Encoder.onStreamError (/home/disgroup/DisBot/node_modules/@discordjs/voice/dist/audio/AudioPlayer.js:213:22)
at Object.onceWrapper (events.js:483:26)
at Encoder.emit (events.js:388:22)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
What does this mean? 
me2
not an error from us
thats from ytdl-core
Okay...thank you
can you suggest another alternative
youtube-dl
thx bro
Now I get another error:
TypeError: adapterCreator is not a function
How can I handle this?