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

160
Vistas
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'guildes' of undefined Discord.js

can you please help me i just need to change the bot status every 10 secs here's the code

const mySecret = process.env['token']

const Discord = require('discord.js')
const client = new Discord.Client();
client.on('ready', () => {
 console.log(`Discord.js: Ready on: ${client.user.tag} ✅`)
 
 const activitives = [
   `${this.client.guildes.cache.size} servers!`,
   `${this.client.channels.cache.size} channels!`,
   `${this.client.guildes.cache.reduce((a,b) => a + b.memberCount, 0)} users!`,
 ];
 
  let i = 0

  setInterval(() => this.client.user.serActivity(`?bhelp |${activities[i++ % activities.length]}`, { type : 'LISTENING'}), 20);
})
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Okay so firstly, its guild not guildes also, you have to remove the .this function Lemme try and redefine the code so you achieve what you want


const Discord = require('discord.js')
const client = new Discord.Client();
client.on('ready', () => {
 console.log(`Discord.js: Ready on: ${client.user.tag} ✅`)
 
 const activities= [
   `${client.guilds.cache.size} servers!`,
   `${client.channels.cache.size} channels!`,
   `${client.users.cache.size} users!`,
 ];
setInterval(() => {
        const index = Math.floor(Math.random() * (activities.length - 1) + 1);
        client.user.setActivity(`?bhelp | ${activities[index]});
    }, 10000);

This should pretty much be it your logic and code was almost perfect, just a few typos and misused functions that I fixed.

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