• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

142
Vistas
Trying to fetch all of the servers that my bot is in
module.exports = {
    name: 'listguilds',
    description: 'lists the bots guilds',
    execute(message, args, client) {
        
        const Guilds = client.guilds.cache.map(guild => guild.id);
    console.log(Guilds);
    }}

Im trying to fetch all the ID's of all of the guilds that my bot is in but i keep getting this error

TypeError: Cannot read property 'guilds' of undefined
    at Object.execute (C:\Users\User\Desktop\botname\commands\listguilds.js:6:31)
    at Client.<anonymous> (C:\Users\User\Desktop\botname\index.js:96:11)
    at Client.emit (node:events:365:28)
    at MessageCreateAction.handle (C:\Users\User\Desktop\botname\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\User\Desktop\botname\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\User\Desktop\botname\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\User\Desktop\botname\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\User\Desktop\botname\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\User\Desktop\botname\node_modules\ws\lib\event-target.js:132:16)
almost 3 years ago · Juan Pablo Isaza
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda