forked from Supositware/Haha-Yes
Show info about a user
This commit is contained in:
parent
ca4bc6e512
commit
6ce45ca621
1 changed files with 64 additions and 0 deletions
64
commands/utility/userInfo.js
Normal file
64
commands/utility/userInfo.js
Normal file
|
@ -0,0 +1,64 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
class userInfoCommand extends Command {
|
||||
constructor() {
|
||||
super('userInfo', {
|
||||
aliases: ['userInfo', 'user'],
|
||||
category: 'utility',
|
||||
clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
|
||||
channelRestriction: 'guild',
|
||||
args: [
|
||||
{
|
||||
id: 'user',
|
||||
type: 'user',
|
||||
},
|
||||
],
|
||||
description: {
|
||||
content: 'Show info about a user',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let user = message.author;
|
||||
|
||||
if (args.user) {
|
||||
user = args.user;
|
||||
}
|
||||
|
||||
let member = message.guild.member(user);
|
||||
|
||||
const Embed = new MessageEmbed()
|
||||
.setColor(member.displayHexColor)
|
||||
.setAuthor(`${user.tag} (${user.id})`, user.displayAvatarURL())
|
||||
.addField('Current rank hex color', member.displayHexColor, true)
|
||||
.addField('Joined guild at', member.joinedAt, true)
|
||||
.addField('Date when account created', user.createdAt, true)
|
||||
.addBlankField()
|
||||
.setTimestamp();
|
||||
|
||||
// Show user status
|
||||
if (user.presence.activity) Embed.addField('Presence', user.presence.activity, true);
|
||||
|
||||
// Show on which platform they are using discord from
|
||||
if (user.presence.clientStatus) {
|
||||
if (user.presence.clientStatus['mobile']) Embed.addField('Using discord on', '📱 ' + user.presence.clientStatus['mobile'], true);
|
||||
if (user.presence.clientStatus['desktop']) Embed.addField('Using discord on', '💻 ' + user.presence.clientStatus['desktop'], true);
|
||||
if (user.presence.clientStatus['web']) Embed.addField('Using discord on', '☁️ ' + user.presence.clientStatus['web'], true);
|
||||
}
|
||||
|
||||
// Show guild nickname
|
||||
if (member.nickname) Embed.addField('Nickname', member.nickname, true);
|
||||
// Show user locale ( i have no idea what it is ) https://discord.js.org/#/docs/main/master/class/User?scrollTo=locale
|
||||
if (user.locale) Embed.addField('Locale settings', user.locale, true);
|
||||
// Show since when this user have been boosting the current guild
|
||||
if (member.premiumSince) Embed.addField('Boosting this guild since', member.premiumSince, true);
|
||||
|
||||
return message.channel.send({ embed: Embed });
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = userInfoCommand;
|
Loading…
Reference in a new issue