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

257
Vistas
Join an specific voice channel when the bot is ready in discord.js v13

I found some articles about this question. like this.

But it was in discord v12. I want discord.js v13

My code:

client.on("ready", async() => {
const { joinVoiceChannel } = require('@discordjs/voice');
joinVoiceChannel({
            channelId: "863783336860975114",
            guildId: "847071265100791849",
            adapterCreator: channelId.guild.voiceAdapterCreator
        })

// It does not work
}

How can I make my bot that it joins a specific channel when it's ready?

I am using discord.js v13 and node.js v16.15

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In the documentation for @discordjs/voice an in the discord.js guide we see:

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

const connection = joinVoiceChannel({
    channelId: channel.id,
    guildId: channel.guild.id,
    adapterCreator: channel.guild.voiceAdapterCreator,
});

You need to fetch the guild or channel first since you need to use a voiceAdapterCreator.

You can use something like client.channels.fetch to get the channel object.

Example code to put inside ready event:

client.channels.fetch(id) // voice channel's id
    .then((channel) => { // channel object

        const VoiceConnection = joinVoiceChannel({
            channelId: channel.id, // the voice channel's id
            guildId: channel.guild.id, // the guild that the channel is in
            adapterCreator: channel.guild.voiceAdapterCreator // and setting the voice adapter creator
        });
    });

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