Well the code below works fine but the only problem is the bot do not play the full track, so is it even possible to play many hours like 22 hours? any ideas?
I hope I did a great job explaining the problem
node v12.22.10
discord.js v12.5.3
command file test.js:
const ytdl = require('ytdl-core');
const Discord = require('discord.js')
const client = new Discord.Client()
module.exports = {
commands: 'test',
callback: (message, arguments, text, client) => {
const url = 'url here';
if (message.content == '!test') {
if (!message.member.voice.channel) return message.reply("you need to be on a voice channel to play the audio");
message.member.voice.channel.join().then(VoiceConnection => {
VoiceConnection.play(ytdl(url)).on("finish", () =>
VoiceConnection.disconnect());
const logo =
'url here'
const thumb = 'url here'
const embed = new Discord.MessageEmbed()
.setTitle('Playing...')
.setAuthor(message.author.username)
.setTimestamp()
.setThumbnail(thumb)
.setFooter("xx", logo)
.setColor('#447a88')
message.reply(embed)
}).catch(e => console.log(e))
}
}
}