2020-01-11 02:08:53 +00:00
|
|
|
const dateFormat = require('dateformat');
|
|
|
|
|
|
|
|
dateFormat('dddd, mmmm dS, yyyy, h:MM:ss TT');
|
2020-01-10 18:52:10 +00:00
|
|
|
|
|
|
|
exports.run = async (client, message, args, level) => {
|
|
|
|
let user = message.mentions.users.first() || message.author;
|
|
|
|
let member = message.guild.member(user);
|
|
|
|
|
2020-01-10 18:52:40 +00:00
|
|
|
if (!member) {
|
2020-01-10 18:52:10 +00:00
|
|
|
message.delete();
|
|
|
|
return (await message.reply("that member could not be found!")).delete(5000);
|
|
|
|
}
|
|
|
|
|
|
|
|
const millisCreated = new Date().getTime() - user.createdAt.getTime();
|
|
|
|
const daysCreated = millisCreated / 1000 / 60 / 60 / 24;
|
|
|
|
|
|
|
|
const millisJoined = new Date().getTime() - member.joinedAt.getTime();
|
|
|
|
const daysJoined = millisJoined / 1000 / 60 / 60 / 24;
|
|
|
|
|
2020-01-10 18:52:40 +00:00
|
|
|
let roles = member.roles.array().slice(1).sort((a, b) => a.comparePositionTo(b)).reverse().map(role => role.name);
|
2020-01-11 02:08:53 +00:00
|
|
|
if (roles.length < 1) roles = ['None'];
|
2020-01-10 18:52:10 +00:00
|
|
|
|
2020-01-10 18:52:40 +00:00
|
|
|
let game = (user.presence.game && user.presence.game && user.presence.game.name) || 'Not playing a game.'
|
2020-01-10 18:52:10 +00:00
|
|
|
|
|
|
|
await message.delete();
|
|
|
|
message.channel.send({ embed: client.embed(
|
2020-01-11 02:08:53 +00:00
|
|
|
`User info: ${member.user.tag}`,
|
|
|
|
"**This message will be deleted in 60 seconds.** :bomb:",
|
2020-01-10 18:52:10 +00:00
|
|
|
[
|
|
|
|
{
|
|
|
|
name: "= Status =",
|
|
|
|
value: `${user.presence.status[0].toUpperCase() + user.presence.status.slice(1)}`
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= Game =",
|
|
|
|
value: `${(user.presence.game && user.presence.game && user.presence.game.name) || 'Not playing a game.'}`
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= Nickname =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: member.nickname || "None"
|
2020-01-10 18:52:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= Unique User ID (UUID) =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: member.user.id !== null ? member.user.id : "Unknown"
|
2020-01-10 18:52:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= Account Creation Date =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: dateFormat(user.createdAt) !== null ? dateFormat(user.createdAt) : "Unknown"
|
2020-01-10 18:52:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= Days Since Creation =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: daysCreated.toFixed(0) !== null ? daysCreated.toFixed(0) : "Unknown"
|
|
|
|
},
|
2020-01-10 18:52:10 +00:00
|
|
|
{
|
|
|
|
name: "= Server Join Date =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: member.joinedAt !== null ? member.joinedAt : "Unknown"
|
2020-01-10 18:52:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= Days Since Joining =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: daysJoined.toFixed(0) !== null ? daysJoined.toFixed(0) : "Unknown"
|
2020-01-10 18:52:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= Last Spoken =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: member.lastMessage !== null ? `**${member.lastMessage.createdAt}**, at server **${member.lastMessage.guild}**` : "Unknown"
|
2020-01-10 18:52:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "= User Roles =",
|
2020-01-11 02:08:53 +00:00
|
|
|
value: `\`${roles.join('\`, \`')}\``
|
2020-01-10 18:52:10 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
{
|
|
|
|
inline: true,
|
2020-01-11 02:08:53 +00:00
|
|
|
footer: `Sent by ${message.author.tag}`,
|
2020-01-10 18:52:10 +00:00
|
|
|
footerIcon: message.author.avatarURL
|
2020-01-11 02:08:53 +00:00
|
|
|
})
|
|
|
|
})
|
2020-01-10 18:52:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.conf = {
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: true,
|
2020-01-11 02:08:53 +00:00
|
|
|
aliases: ["user", "uinfo"],
|
2020-01-10 18:52:10 +00:00
|
|
|
permLevel: "User"
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.help = {
|
|
|
|
name: "userinfo",
|
|
|
|
category: "Information",
|
|
|
|
description: "Gather information about a user, and returns the gathered stuff into an embed.",
|
|
|
|
usage: "userinfo [ping:self]"
|
|
|
|
};
|