const { Command } = require("discord.js-commando");
const { RichEmbed } = require("discord.js");
module.exports = class UInfoCommand extends Command {
constructor(client) {
super (client, {
name: "uinf",
group: "other",
memberName: "uinf",
description: "Покажет информацию о пользователе.",
args: [{
key: "member",
label: "user",
type: "member",
prompt: "Упомините пользователя."
}]
});
}
async run(msg, { member }) {
var user = member.user;
var userStats = user.presence.status.split("");
userStats[0] = userStats[0].toUpperCase();
userStats = userStats.join("");
var embed = new RichEmbed()
.setTitle(user.tag +"'s info")
.setThumbnail(user.avatarURL)
.setColor(0xFF0090)
.addField("ID пользователя", user.id)
.addField("Присоединился", member.joinedAt)
.addField("Создан", member.user.createdAt)
.addField("Играет в", user.presence.game ? user.presence.game.name : "None")
.addField("Роли на сервере", "```"+ member.roles.map(roles => roles.name).join(", ") +"```")
.addField("Статус", userStats);
return msg.channel.send(embed);
}
}