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

131
Views
discord.js command on avatar

I have a problem with the avatar display command. It keep saying this:

TypeError: Cannot read property 'members' of undefined

Code:

const { Client, Message, MessageEmbed } = require('discord.js')

module.exports = {

    name: 'avatar',
    execute: async(client, message, args) => {
        const member = message.mentions.members.first() || message.member;

        message.channel.send(
            new MessageEmbed()
            .setTitle(`${member.user.tag}'s avatar`)
            .setImage(member.user.displayAvatarURL({ dynamic: true, size: 512}))
            .setColor('RED')
        );
    },
};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The only explanation here is that you passed your parameters in the wrong order. Your declaration is like this:

(client, message, args)

however your execution parameters are passed in incorrectly. I suspect they might look something like this:

(message, client, args)

but they must be in the right order

(client, message, args)
about 4 years ago · Juan Pablo Isaza 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!