Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

416
Vistas
discord.js v13 temp voice channels - joinVoiceChannel() @discordjs/voice

I am trying to add a command, that allows the creation of temporary voice channels.

I have created a new client within this command to try and get the joinVoiceChannel() params another way.

File:

const { joinVoiceChannel } = require ('@discordjs/voice')

module.exports = {
  emoji: '🔈',
  name: 'voice',
  description: 'Create a temporary voice channel',
  execute(interaction) {
    console.log('hi')
    joinVoiceChannel({
      channelId: interaction.channel.id,
      guildId: interaction.guild.id,
      adapterCreator: interaction.guild.voiceAdapterCreator,
    })
  }
}

Error:

TypeError: Cannot read property 'id' of undefined
    at Object.execute (C:\Users\tomfi\Code\DiscordBot\commands\voice.js:11:38)
    at module.exports (C:\Users\tomfi\Code\DiscordBot\events\messageCreate.js:16:17)
    at Client.emit (node:events:394:28)
    at MessageCreateAction.handle (C:\Users\tomfi\Code\DiscordBot\node_modules\discord.js\src\client\actions\MessageCreate.js:23:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\tomfi\Code\DiscordBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\tomfi\Code\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:345:31)
    at WebSocketShard.onPacket (C:\Users\tomfi\Code\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:443:22)
    at WebSocketShard.onMessage (C:\Users\tomfi\Code\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10)
    at WebSocket.onMessage (C:\Users\tomfi\Code\DiscordBot\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (node:events:394:28)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

joinVoiceChannel does not create a voice channel, it creates a voice connection. You need to use GuildChannelManager.create instead. Here is how:

const channel = await interaction.guild.channels.create("VC_NAME", {
  type: "GUILD_VOICE" //note it is "GUILD_VOICE" and not just "voice" anymore
}
joinVoiceChannel({
  channelId: channel.id,
  guildId: interaction.guild.id,
  adapterCreator: interaction.guild.voiceAdapterCreator,
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda