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

605
Vistas
Discord.js: TypeError: Cannot read properties of undefined (reading 'has')

I am creating a Discord music bot using discord.js version 13.6.0 and discord-player but I keep getting this error, here is my code:

const { MessageEmbed, Permissions } = require('discord.js');

module.exports = {
    name: 'stop',
    aliases: [],
    utilisation: '{prefix}stop',
    voiceChannel: true,

    execute(client, message) {
        if (message.member.id.permissions.has(Permissions.FLAGS.KICK_MEMBERS)) {
            // Stop the player
        };
    },
};

The error I get when running that command:

if(message.member.id.permissions.has(Permissions.FLAGS.KICK_MEBERS)){

TypeError: Cannot read properties of undefined (reading 'has')

I don't know why this is happening, please could someone help me?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You are trying to read permissions from the member.id.

If you take a look at the DiscordJS Documentation for member, and look at the available properties, it has both id and permissions.

So, changing your line to message.member.permissions.has(Permissions.FLAGS.KICK_MEBERS) instead of message.member.id.permissions.has(Permissions.FLAGS.KICK_MEBERS) should fix this for you.

about 4 years ago · Santiago Trujillo 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