Hello, i’m making a bot for my discord server. The music function used to work before, but now it doesn’t. The bot has a green circle like it is playing music but i don’t seem to hear anything.
My play function is
function play(guild, song) {
const serverQueue = queue.get(guild.id);
if (!song) {
serverQueue.voiceChannel.leave();
queue.delete(guild.id);
return;
}
const dispatcher = serverQueue.connection
.playStream(ytdl(song.url,{filter: “audioonly”}),{seek: 0,
passes: 2, //can be increased to reduce packetloss at the expense of upload bandwidth, 4-5 should be lossless at the expense of 4-5x upload
volume: 0.5})
.on(“finish”, () => {
serverQueue.songs.shift();
play(guild, serverQueue.songs[0]);
})
.on(“error”, error => console.error(error));
at Object.Module._extensions…js (module.js:664:10)
5:03 PM
at Module.load (module.js:566:32)
5:03 PM
at tryModuleLoad (module.js:506:12)
5:03 PM
at Function.Module._load (module.js:498:3)
5:03 PM
at Module.require (module.js:597:17)
5:03 PM
at require (internal/module.js:11:18)
5:03 PM
at Object. (/rbd/pnpm-volume/9d3b317e-46de-4321-91aa-bbc8c2baf5f4/node_modules/.registry.npmjs.org/discord.js/12.1.1/node_modules/discord.js/src/index.js:8:11)
They switched to things called managers which means now everything like channels is in the .cache portion. Also instead of channels.createChannel it’s like channels.cache.create