类型错误:无法读取未定义的属性“用户”(Discord Bot)

时间:2021-02-18 20:49:23

标签: node.js discord.js

    client.on('message', message =>{
    if (message.author.bot) return;
    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const command = args.shift().toLowerCase();

    if (command == 'avatar') {
        const usuario = message.mentions.users.first() || message.member;
        const embed = new MessageEmbed()
            .setColor('RANDOM')
            .setImage(usuario.user.displayAvatarURL)
            .setDescription(`Avatar del usuario ${usuario.user.username}`);
        message.channel.sent(embed);
    }

问题在 (usuario.user.displayAvatarURL)

0 个答案:

没有答案