Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

606
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!