2020-01-25 10:02:43 +00:00
|
|
|
const Discord = require("discord.js");
|
|
|
|
|
|
|
|
exports.run = (client, message, args) => {
|
|
|
|
var user;
|
2020-03-09 01:11:33 +00:00
|
|
|
var guild;
|
|
|
|
var nick = "";
|
|
|
|
var roles = "";
|
|
|
|
var presence = "";
|
|
|
|
var badges = "";
|
|
|
|
var status;
|
|
|
|
var createdAt;
|
|
|
|
var avurl;
|
2020-01-25 10:02:43 +00:00
|
|
|
var tag;
|
|
|
|
var id;
|
2020-03-09 01:11:33 +00:00
|
|
|
var bot;
|
2020-01-25 10:02:43 +00:00
|
|
|
|
|
|
|
if(message.guild) {
|
|
|
|
user = message.mentions.members.first();
|
|
|
|
|
|
|
|
if(!args[0]) {
|
2020-03-09 01:11:33 +00:00
|
|
|
user = message.guild.members.cache.get(message.author.id)
|
|
|
|
};
|
|
|
|
|
2020-01-25 10:02:43 +00:00
|
|
|
if (!user) {
|
|
|
|
var users;
|
|
|
|
users = client.searchForMembers(message.guild, args[0]);
|
|
|
|
if (users.length > 1)
|
|
|
|
return message.channel.send(
|
|
|
|
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
|
|
|
|
);
|
|
|
|
else if (users.length == 0)
|
|
|
|
return message.channel.send(
|
|
|
|
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
|
|
|
|
);
|
|
|
|
user = users[0];
|
|
|
|
};
|
|
|
|
|
2020-03-09 01:11:33 +00:00
|
|
|
if(user.nickname) {
|
|
|
|
nick = `\n• **Nickname:** ${user.nickname}`;
|
2020-01-25 10:02:43 +00:00
|
|
|
};
|
|
|
|
|
2020-03-09 01:11:33 +00:00
|
|
|
if(user.user.id == message.guild.ownerID) {
|
2020-03-09 22:37:48 +00:00
|
|
|
badges += "<:owner:685703193694306331>"
|
|
|
|
}
|
|
|
|
|
|
|
|
if(user.user.bot) {
|
|
|
|
badges += "<:bot:686489601678114859>"
|
|
|
|
}
|
|
|
|
|
|
|
|
if(badges.length > 0) {
|
|
|
|
badges += "\n"
|
2020-03-09 01:11:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
user.roles.cache.forEach((role) => {
|
|
|
|
roles = roles + role.name + "`, `"
|
|
|
|
});
|
|
|
|
|
|
|
|
roles = roles.substr(0, roles.length -4);
|
|
|
|
|
|
|
|
guild = `\n• **Roles:** \`${roles}\`\n• **Server join date:** ${user.joinedAt}`;
|
|
|
|
|
2020-01-25 10:02:43 +00:00
|
|
|
id = user.user.id;
|
2020-03-09 01:11:33 +00:00
|
|
|
tag = user.user.tag;
|
|
|
|
colour = user.displayHexColor;
|
2020-03-09 22:37:48 +00:00
|
|
|
avurl = user.user.avatarURL({format: "png", dynamic: true, size: 2048});
|
2020-01-25 10:02:43 +00:00
|
|
|
createdAt = user.user.createdAt;
|
|
|
|
} else {
|
|
|
|
id = user.id;
|
2020-03-09 01:11:33 +00:00
|
|
|
tag = user.tag;
|
2020-01-25 10:02:43 +00:00
|
|
|
colour = ["#ff9d68", "#ff97cb", "#d789ff", "#74FFFF"].random();
|
2020-03-09 22:37:48 +00:00
|
|
|
avurl = user.avatarURL({format: "png", dynamic: true, size: 2048});
|
2020-03-09 01:11:33 +00:00
|
|
|
createdAt = user.createdAt;
|
2020-01-25 10:02:43 +00:00
|
|
|
};
|
|
|
|
|
2020-03-09 01:11:33 +00:00
|
|
|
if(user.presence.status == "online") {
|
|
|
|
status = `online <:status_online:685462758023626762>`
|
|
|
|
};
|
2020-01-25 10:02:43 +00:00
|
|
|
|
2020-03-09 01:11:33 +00:00
|
|
|
if(user.presence.status == "idle") {
|
|
|
|
status = `idle <:status_idle:685462771529154561>`
|
2020-01-25 10:02:43 +00:00
|
|
|
};
|
|
|
|
|
2020-03-09 01:11:33 +00:00
|
|
|
if(user.presence.status == "dnd") {
|
|
|
|
status = `do not disturb <:status_dnd:685462782963220495>`
|
|
|
|
};
|
|
|
|
|
|
|
|
if(user.presence.status == "offline") {
|
|
|
|
status = `offline <:status_offline:685462758229016633>`
|
|
|
|
};
|
|
|
|
|
|
|
|
if(user.presence.activities[0]) {
|
|
|
|
presence = "\n• **Presence:** ";
|
|
|
|
if(user.presence.activities[0].type == "PLAYING") {
|
|
|
|
presence += `Playing ${user.presence.activities[0].name}`;
|
|
|
|
};
|
|
|
|
|
|
|
|
if(user.presence.activities[0].type == "STREAMING") {
|
|
|
|
presence += `Streaming ${user.presence.activities[0].name}`;
|
|
|
|
};
|
|
|
|
|
|
|
|
if(user.presence.activities[0].type == "CUSTOM_STATUS") {
|
|
|
|
presence += `${user.presence.activities[0].state}`;
|
|
|
|
};
|
2020-01-25 10:02:43 +00:00
|
|
|
};
|
|
|
|
|
2020-03-09 01:11:33 +00:00
|
|
|
embed = new Discord.MessageEmbed();
|
|
|
|
embed.setTitle(tag);
|
|
|
|
embed.setThumbnail(avurl);
|
|
|
|
embed.setDescription(`${badges}• **ID:** ${id}${nick}\n• **Status:** ${status}${presence}${guild}\n• **Account created:** ${createdAt}`)
|
2020-01-25 10:02:43 +00:00
|
|
|
embed.setColor(colour);
|
|
|
|
message.channel.send(embed);
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.conf = {
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: false,
|
|
|
|
aliases: ["uinfo", "user"],
|
|
|
|
permLevel: "User",
|
|
|
|
requiredPerms: ["EMBED_LINKS"]
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.help = {
|
|
|
|
name: "userinfo",
|
|
|
|
category: "Utility",
|
|
|
|
description: "Displays some useful information about the specified user.",
|
|
|
|
usage: "userinfo <user>"
|
|
|
|
};
|