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

105
Vistas
Discord.js Role.id.client is undefined

I have the following issue: I'm using Role.id.client to check if the user has the following role. It does throw the error on the bottom, but the term should be correct. Can somebody help me?

client.on("voiceStateUpdate", (oldState, newState) => {

    if(newState.channelId === `937722527894089806` && Role.id.client ==! `938113190041124885`) {

The error code:

[nodemon] starting `node src/index.js`
Ready! Logged in as Rainbow Six | DE Test Bot#0280!
C:\Users\emre2\Desktop\Coding\Visualstudiodateien\src\index.js:56
    if(Role.id.client ==! `938113190041124885`) {    //Warten
           ^

TypeError: Cannot read properties of undefined (reading 'client')
    at Client.<anonymous> (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\src\index.js:56:16)
    at Client.emit (node:events:390:28)
    at VoiceStateUpdate.handle (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\node_modules\discord.js\src\client\actions\VoiceStateUpdate.js:38:14)
    at Object.module.exports [as VOICE_STATE_UPDATE] (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\node_modules\discord.js\src\client\websocket\handlers\VOICE_STATE_UPDATE.js:4:35)
    at WebSocketManager.handlePacket (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31)
    at WebSocketShard.onPacket (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\node_modules\ws\lib\event-target.js:199:18)
    at WebSocket.emit (node:events:390:28)
    at Receiver.receiverOnMessage (C:\Users\emre2\Desktop\Coding\Visualstudiodateien\node_modules\ws\lib\websocket.js:1098:20)
[nodemon] app crashed - waiting for file changes before starting...
about 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda