H
H
Heng Petrov2021-04-25 13:10:34
Node.js
Heng Petrov, 2021-04-25 13:10:34

Invalid Date after command. What to do?

module.exports.run = async (bot, message, args) => {

    if (!args[0]) {
        let status = ''
        switch (message.author.presence.status) {
            case 'online':
                status = ':green_circle: Онлайн';
                break;
            case 'idle':
                status = ':orange_circle: Нет на месте';
                break;
            case 'offline':
                status = ':black_circle: Нет в сети';
                break;
            case 'dnd':
                status = ':red_circle: Не беспокоить';
                break;
        }
        const embed = new Discord.MessageEmbed()
            .setTitle('**Информация о данном пользователе**')
            .setFooter('Команда .user')
            .setColor('#027ec2')
            .setTimestamp()
            .setThumbnail(message.author.avatarURL())
            .addFields({
                name: '**NickName:**',
                value: `${message.author.tag}`,
                inline: true
            }, {
                name: '**Discord ID:**',
                value: `${message.author.id}`,
                inline: true
            }, {
                name: '**Статус:**',
                value: `${status}`,
                inline: false
            }, {
                name: '**Дата создания аккаунта:**',
                value: `${message.author.createdAt.toLocaleDateString()}`,
                inline: false
            }, {
                name: '**Дата входа на сервер**',
                value: `${message.member.joinedAt.toLocaleDateString()}`,
                inline: true
            }, )
        message.channel.send(embed)
    } else {
        let rUser = message.mentions.users.first()
        let statuss = ''
    switch (rUser.presence.status) {
        case 'online':
            statuss = ':green_circle: Онлайн';
            break;
        case 'idle':
            statuss = ':orange_circle: Нет на месте';
            break;
        case 'offline':
            statuss = ':black_circle: Нет в сети';
            break;
        case 'dnd':
            statuss = ':red_circle: Не беспокоить';
            break;
    }
    
        const membed = new Discord.MessageEmbed()
            .setTitle('**Информация о данном пользователе**')
            .setFooter('Команда .user @упоминание')
            .setColor('#027ec2')
            .setTimestamp()
            .setThumbnail(rUser.avatarURL())
            .addFields({
                name: '**NickName:**',
                value: `${rUser.tag}`,
                inline: true
            }, {
                name: '**Discord ID:**',
                value: `${rUser.id}`,
                inline: true
            }, {
                name: '**Статус:**',
                value: `${statuss}`,
                inline: false
            }, {
                name: '**Дата создания аккаунта:**',
                value: `${rUser.createdAt.toLocaleDateString()}`,
                inline: false
            }, {
                name: '**Дата входа на сервер**',
                value: `${new Date(rUser.joinedAt).toLocaleDateString()}`,
                inline: true
            }, )
        message.channel.send(membed)
    }
}

module.exports.help = {
    name: "user",
    category: "global",
    aliases: ["user"],
    usage: 'user',
    descreption: 'Проверка профиля'
}


The error itself occurred in the "Server Entry Date" column.
6085400dc3dff421772792.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question