const { MessageEmbed } = require ("discord.js");
const { MESSAGES } = require("../../util/constants");

module.exports.run = (client, message, args) => {
    const embed = new MessageEmbed()
        .setColor("#0c2461")
        .setAuthor(`${client.user.username} Info`, client.user.avatarURL())
        .addFields(
            { name: 'Mémoire', value: `${(process.memoryUsage().heapUsed / 1024 /1024).toFixed(2)}MB`, inline: true},
            { name: 'Uptime', value: `${Math.floor(client.uptime / 1000 / 60).toString()} minutes`, inline: true},
            { name: '\u200b', value: `\u200b`, inline: true},
            { name: 'Serveurs', value: `${client.guilds.cache.size.toString()}`, inline: true},
            { name: 'Salons', value: `${client.channels.cache.size.toString()}`, inline: true},
            { name: 'Utilisateurs', value: `${client.guilds.cache.map(g => g.memberCount).reduce((a,b) => a + b)}`, inline: true},
            { name: 'Version', value: `Version 2.2.1`, inline: true},
            { name: 'Source', value: `[SiteWeb](https://lan7ium.fr)`, inline: true},
            { name: 'Support', value: `[Serveur Invite](https://discord.gg/K6tGTtNVTE)`, inline: true},
        );
    message.channel.send(embed);
};

module.exports.help = MESSAGES.COMMANDS.INFORMATIONS.BOTINFO;