lbry-wunderbot/src/commands/util/user.info.js
2018-05-19 23:35:45 +02:00

42 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { stripIndents } = require("common-tags");
const commando = require("discord.js-commando");
module.exports = class UserInfoCommand extends commando.Command {
constructor(client) {
super(client, {
name: "user-info",
aliases: ["user", "🗒"],
group: "util",
memberName: "user-info",
description: "Gets information about a user.",
examples: ["user-info @Crawl#3208", "user-info Crawl"],
guildOnly: true,
args: [
{
key: "member",
label: "user",
prompt: "What user would you like to snoop on?",
type: "member"
}
]
});
}
async run(msg, { member }) {
const { user } = member;
return msg.reply(stripIndents`
Info on **${user.username}#${user.discriminator}** (ID: ${user.id})
** Member Details**
${member.nickname !== null ? ` • Nickname: ${member.nickname}` : " • No nickname"}
• Roles: ${member.roles.map(roles => `\`${roles.name}\``).join(", ")}
• Joined at: ${member.joinedAt}
** User Details**
• Created at: ${user.createdAt}${user.bot ? "\n • Is a bot account" : ""}
• Status: ${user.presence.status}
• Game: ${user.presence.game ? user.presence.game.name : "None"}
`);
}
};