Add userinfo command
This commit is contained in:
parent
41088e06bd
commit
89cbd86be9
1 changed files with 41 additions and 0 deletions
41
commands/userinfo.js
Normal file
41
commands/userinfo.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
const Discord = require('discord.js');
|
||||||
|
const parseMention = require("../util/parseMention.js")
|
||||||
|
const creationJoinDates = require("../util/creationJoinDates")
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: 'userinfo',
|
||||||
|
description: 'Displays various information about the user(not done)',
|
||||||
|
execute(message, client, args) {
|
||||||
|
if (!args[0]) {
|
||||||
|
info = message.author;
|
||||||
|
} else {
|
||||||
|
info = parseMention.parseMention(args[0], message.guild);
|
||||||
|
}
|
||||||
|
|
||||||
|
user = message.guild.members.cache.get(info.id);
|
||||||
|
var nickname = "";
|
||||||
|
if (user.nickname) {
|
||||||
|
nickname = `<:aka:572089580925485058> ${user.nickname} `;
|
||||||
|
}
|
||||||
|
|
||||||
|
var roleColor = 15788778;
|
||||||
|
|
||||||
|
if (user.roles.color.color) {
|
||||||
|
roleColor = user.roles.color.color;
|
||||||
|
}
|
||||||
|
|
||||||
|
var creatJoin = creationJoinDates(client)
|
||||||
|
console.log(creatJoin)
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.setThumbnail(user.user.avatarURL({ format: 'png', dynamic: true, size: 2048 }))
|
||||||
|
.setColor(roleColor)
|
||||||
|
.setTimestamp()
|
||||||
|
.setAuthor(info.username, "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048")
|
||||||
|
.addField("Username", `**${user.user.username}#${user.user.discriminator}**${nickname}`)
|
||||||
|
.addField("Joined", creatJoin.joindate, true)
|
||||||
|
.addField("Creation date", creatJoin.datecreate, true)
|
||||||
|
|
||||||
|
message.channel.send(embed);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue