2019-10-24 18:54:23 +00:00
|
|
|
|
const client = require("../utils/client.js");
|
|
|
|
|
|
|
|
|
|
exports.run = async (message, args) => {
|
|
|
|
|
const getUser = message.mentions.length >= 1 ? message.mentions[0] : (args.length !== 0 ? client.users.get(args[0]) : message.author);
|
2020-03-05 15:28:10 +00:00
|
|
|
|
let user;
|
|
|
|
|
if (getUser) {
|
|
|
|
|
user = getUser;
|
|
|
|
|
} else if (args.join(" ") !== "") {
|
|
|
|
|
const userRegex = new RegExp(args.join("|"), "i");
|
|
|
|
|
const member = client.users.find(element => {
|
|
|
|
|
return userRegex.test(element.username);
|
|
|
|
|
});
|
|
|
|
|
user = member ? member : message.author;
|
|
|
|
|
} else {
|
|
|
|
|
user = message.author;
|
|
|
|
|
}
|
|
|
|
|
//const user = getUser !== undefined ? getUser : (message.author);
|
2019-10-24 18:54:23 +00:00
|
|
|
|
const member = message.channel.guild.members.get(user.id);
|
|
|
|
|
const infoEmbed = {
|
|
|
|
|
"embed": {
|
|
|
|
|
"title": `${user.username}#${user.discriminator}`,
|
|
|
|
|
"thumbnail": {
|
|
|
|
|
"url": user.avatarURL
|
|
|
|
|
},
|
|
|
|
|
"color": 16711680,
|
|
|
|
|
"fields": [
|
|
|
|
|
{
|
|
|
|
|
"name": "🔢 **ID:**",
|
|
|
|
|
"value": user.id
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "📛 **Nickname:**",
|
2020-01-30 18:50:45 +00:00
|
|
|
|
"value": member ? (member.nick ? member.nick : "None") : "N/A"
|
2019-10-24 18:54:23 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "🤖 **Bot:**",
|
|
|
|
|
"value": user.bot ? "Yes" : "No"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "🗓️ **Joined Discord on:**",
|
|
|
|
|
"value": new Date(user.createdAt).toString()
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "💬 **Joined this server on:**",
|
2020-01-30 18:55:26 +00:00
|
|
|
|
"value": member ? new Date(member.joinedAt).toString() : "N/A"
|
2019-10-24 18:54:23 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "ℹ️ **Status:**",
|
2020-01-30 18:55:26 +00:00
|
|
|
|
"value": member ? member.status : "Unknown"
|
2019-10-24 18:54:23 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "🎮 **Playing:**",
|
2020-01-30 18:55:26 +00:00
|
|
|
|
"value": member ? (member.game ? member.game.name : "Nothing") : "Unknown"
|
2019-10-24 18:54:23 +00:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|
2020-04-12 19:51:48 +00:00
|
|
|
|
return infoEmbed;
|
2019-10-24 18:54:23 +00:00
|
|
|
|
};
|
|
|
|
|
|
2019-12-02 20:47:22 +00:00
|
|
|
|
exports.aliases = ["user"];
|
|
|
|
|
exports.category = 1;
|
2019-12-05 16:58:46 +00:00
|
|
|
|
exports.help = "Gets info about a user";
|
|
|
|
|
exports.params = "{mention/id}";
|