Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

421
Views
voiceChannel.join() no es un nodo de función v16 discord.js

Hice un bot que reproduce música. Actualicé a NodeJS v16.6.1 y voiceChannel.join ya no funciona. Ya intenté usar const { voiceChannel } = require('@discord.js/voice'); pero solo dice módulo no encontrado. Código:

 const ytdl = require("ytdl-core"); const ytSearch = require("yt-search"); module.exports = { name: 'play', 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 neccesary permissions'); if (!permissions.has("SPEAK")) return message.channel.send('You dont have the neccesary permissions'); if (!args.length) return message.channel.send('Define Video'); 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(`Now Playing **${video.title}**`) } else { message.channel.send('No videos found'); } } }```
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como dice el error, voiceChannel#join no es, de hecho, una función. Si bien existía en Discord.js v12, que supongo que estaba usando antes de actualizar su versión de Node.js, tenga en cuenta que no se encuentra en ninguna parte de la documentación de Discord.js v13 en VoiceChannel . En su lugar, debe migrar a @discordjs/voice , cuya funciónjoinVoiceChannel se puede usar como reemplazo.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!