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

119
Visualizações
¿Cómo agrego cola en mi bot de música usando Discord.js?

Este es mi comando de reproducción para mi bot de música.

 module.exports = { name: 'p', description: 'Joins and plays a video from youtube', async execute(message, args) { const voiceChannel = message.member.voice.channel; if (!voiceChannel) return message.channel.send('You need to be in a channel to execute this command!'); const permissions = voiceChannel.permissionsFor(message.client.user); if (!permissions.has('CONNECT')) return message.channel.send('You dont have the correct permissins'); if (!permissions.has('SPEAK')) return message.channel.send('You dont have the correct permissins'); if (!args.length) return message.channel.send('You need to send the second argument!'); const validURL = (str) =>{ var regex = /(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/; if(!regex.test(str)){ return false; } else { return true; } } if(validURL(args[0])){ const connection = await voiceChannel.join(); const stream = ytdl(args[0], {filter: 'audioonly'}); connection.play(stream, {seek: 0, volume: 1}) .on('finish', () =>{ voiceChannel.leave(); message.channel.send('leaving channel'); }); await message.reply(`:thumbsup: Now Playing ***Your Link!***`) return } const connection = await voiceChannel.join(); const videoFinder = async (query) => { const videoResult = await ytSearch(query); return (videoResult.videos.length > 1) ? videoResult.videos[0] : null; } const video = await videoFinder(args.join(' ')); if(video){ const stream = ytdl(video.url, {filter: 'audioonly'}); connection.play(stream, {seek: 0, volume: 1}) .on('finish', () =>{ voiceChannel.leave(); }); await message.reply(`:thumbsup: Now Playing ***${video.title}***`) } else { message.channel.send('No video results found'); } } }

Lo que hace esto es !p *name of the song/link* y luego se une y toca, pero no puedo hacer dos canciones. Y que cuando acaba el primero, toca el segundo.

Quiero agregar un sistema de cola y saltar el comando. ¿Podría ayudarme a agregar un sistema de colas y saltos?

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