Merge remote-tracking branch 'origin/master'

This commit is contained in:
rhearmas 2020-01-10 20:25:55 -05:00
commit 4b4fd90599
2 changed files with 74 additions and 57 deletions

View file

@ -48,13 +48,13 @@ async function getUUID(username) {
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["mcinfo","minecraftuser"],
aliases: ["minecraftuser"],
permLevel: "User"
};
exports.help = {
name: "playerinfo",
name: "mcinfo",
category: "Information",
description: "Shows information about a Minecraft player.",
usage: "playerinfo <username>"
usage: "mcinfo <username>"
};

View file

@ -1,19 +1,13 @@
const dateFormat = require('dateformat');
dateFormat('dddd, mmmm dS, yyyy, h:MM:ss TT');
function titleCase(str) {
str = str.toLowerCase().split(' ');
for (let i = 0; i < str.length; i++) {
str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);
}
return str.join(' ');
}
exports.run = async (client, message, args, level) => {
if (!message.guild) {
message.delete();
return (await message.reply("this can only be used in a guild!")).delete(5000);
}
if (message.mentions.users.size < 1) {
message.delete();
return (await message.reply("@mention someone to find their info.")).delete(5000);
}
let user = message.mentions.users.first();
let user = message.mentions.users.first() || message.author;
let member = message.guild.member(user);
if (!member) {
@ -30,61 +24,84 @@ exports.run = async (client, message, args, level) => {
let roles = member.roles.array().slice(1).sort((a, b) => a.comparePositionTo(b)).reverse().map(role => role.name);
if (roles.length < 1) roles = ['None'];
let embed = client.embed(
`${user.username}#${message.mentions.users.first().discriminator}`,
'***This message will dissappear in 60 seconds.***',
let game = (user.presence.game && user.presence.game && user.presence.game.name) || 'Not playing a game.'
await message.delete();
message.channel.send({ embed: client.embed(
`User info: ${target.user.tag}`,
"**This message will be deleted in 60 seconds. :bomb:",
[
{
name: 'Status',
value: `${user.presence.status[0].toUpperCase() + user.presence.status.slice(1)}`,
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: "= Game =",
value: `${(user.presence.game && user.presence.game && user.presence.game.name) || 'Not playing a game.'}`
},
{
name: 'Created On',
value: `${dateFormat(user.createdAt)}`,
name: "= Nickname =",
value: target.guildMember.nickname,
inline: true
},
{
name: 'Days Since Creation',
value: `${daysCreated.toFixed(0)}`,
name: "= Unique User ID (UUID) =",
value: target.user.id,
inline: true
},
{
name: 'Joined On',
value: `${dateFormat(member.joinedAt)}`,
name: "= Shared Servers =",
value: target.userProfile.mutualGuilds,
inline: true
},
{
name: 'Days Since Joining',
value: `${daysJoined.toFixed(0)}`,
name: "= Account Creation Date =",
value: dateFormat(user.createdAt),
inline: true
},
{
name: 'Roles',
value: `\`${roles.join('`, `')}\``,
inline: false,
name: "= Days Since Creation =",
value: daysCreated.toFixed(0),
inline: true
}
{
name: "= Server Join Date =",
value: target.guildMember.joinedAt,
inline: true
},
{
name: "= Days Since Joining =",
value: daysJoined.toFixed(0),
inline: true
},
{
name: "= Last Spoken =",
value: `**${target.guildMember.lastMessage.createdAt}**, at server **${target.guildMember.lastMessage.guild}**`,
inline: true
},
{
name: "= User Roles =",
value: roles,
inline: true
}
],
{
inline: true,
footer: `User ID: ${user.id}`,
thumbnail: user.displayAvatarURL
}
);
message.delete();
(await message.channel.send({ embed })).delete(60000);
footer: `Sent by ${message.author}`
footerIcon: message.author.avatarURL
});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
guildOnly: true,
aliases: ["user","uinfo"],
permLevel: "User"
};
exports.help = {
name: "userinfo",
category: "Information",
description: "Provides some information about a mentioned user.",
usage: "userinfo <@mention>"
description: "Gather information about a user, and returns the gathered stuff into an embed.",
usage: "userinfo [ping:self]"
};