0
votes

I'm getting this:

(node:5496) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read prope rty 'map' of null

(node:5496) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Everytime i run my "userinfo" command

const prefix = require('../../settings.json').prefix;
const Discord = require('discord.js');
const commando = require('discord.js-commando');

class UserInfo extends commando.Command {
    constructor(client) {
        super(client, {
            name: 'userinfo',
            group: 'showinfo',
            memberName: 'userinfo',
            description: 'Muestra la información de un usuario.'
        });
    }

    async run (message, args) {
        if(message.author.bot) return;
        if(message.channel.type === "dm") return;

        var embed = new Discord.RichEmbed()
            .setAuthor(message.author.username)
            .setDescription("Usuario rikolino.")
            .setColor("#3535353")
            .addField("Usuario", '${message.author.username}#${message.author.discriminator}')
            .addField("ID", message.author.id)
            .addField("Creación", message.author.createdAt);

        message.channel.sendEmbed(embed);
        return;
    }
}

module.exports = UserInfo;
1

1 Answers

1
votes

As of May the 1st, .sendEmbed() is now depreciated. It is now part of the .send() method and to send embeds you will now have to type:

message.channel.send({embed});

enter image description here - https://github.com/hydrabolt/discord.js/releases/tag/11.1.0

So in your case,

var embed = new Discord.RichEmbed()
            .setAuthor(message.author.username)
            .setDescription("Usuario rikolino.")
            .setColor("#3535353")
            .addField("Usuario", '${message.author.username}#${message.author.discriminator}')
            .addField("ID", message.author.id)
            .addField("Creación", message.author.createdAt);

        message.channel.send({embed});
        return;