Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

457
Visualizações
Can discord bot able to play a youtube video/audio (ytdl) around 22 hours?

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))

        }
    }
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda