-
Notifications
You must be signed in to change notification settings - Fork 2
/
userinfo.js
50 lines (48 loc) · 1.69 KB
/
userinfo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
Copyright 2021 Aman Verma. All rights reserved.
Use of this source code is governed by a MIT license that can be
found in the LICENSE file.
*/
const Discord = require("discord.js");
module.exports = {
name: "userinfo",
run: async (client, message) => {
if (!message.member.permissions.has("MANAGE_MESSAGES"))
message.channel.send(
"You don't have permission to use that command."
);
else {
let user = message.mentions.users.first();
if (!user) {
message.channel.send("No User Mentioned");
} else {
user = message.guild.members.resolve(user);
const premiumSince =
user.premiumSince === null
? "Not using currently"
: String(user.premiumSince);
const embed = new Discord.MessageEmbed()
.setTitle("User Info")
.setColor(user.displayHexColor)
.addFields([
{ name: "Name", value: user.displayName },
{
name: "Joined This Server on",
value: String(user.joinedAt)
},
{
name: "Discord Nitro Since",
value: premiumSince
}
]);
try {
message.channel.send({ embeds: [embed] });
} catch (err) {
console.log(err);
}
}
}
},
aliases: [],
description: "Gives Info About a User"
};