2022-04-21 20:53:03 -05:00
|
|
|
const { Constants } = require('discord.js');
|
|
|
|
|
2022-03-21 10:28:55 -05:00
|
|
|
module.exports = {
|
2022-04-18 11:25:40 -05:00
|
|
|
|
|
|
|
name: require('path').parse(__filename).name,
|
2022-04-21 18:09:21 -05:00
|
|
|
description: 'Gets info about an user, such as ID, Discord Join date and more',
|
2022-04-21 20:53:03 -05:00
|
|
|
options: [{
|
|
|
|
name: 'user',
|
|
|
|
description: 'Another user',
|
|
|
|
required: false,
|
|
|
|
type: Constants.ApplicationCommandOptionTypes.USER
|
|
|
|
}],
|
2022-04-18 11:25:40 -05:00
|
|
|
|
2022-04-21 23:44:02 -05:00
|
|
|
async parseInteraction (client, config, interaction) {
|
|
|
|
const target = interaction.options.getUser('user') ? (await interaction.guild.members.fetch(interaction.options.getUser('user'))) : interaction.member;
|
|
|
|
await interaction.reply(this.handle(client, config, interaction.user, target));
|
|
|
|
},
|
2022-04-21 18:09:21 -05:00
|
|
|
|
2022-04-21 23:44:02 -05:00
|
|
|
handle (client, config, user, target) {
|
|
|
|
return {
|
2022-04-21 18:09:21 -05:00
|
|
|
embeds: [{
|
2022-07-04 11:08:50 -05:00
|
|
|
title: `Everything you've ever wanted to know about ${target.user.username}!`,
|
2022-04-21 18:09:21 -05:00
|
|
|
color: 9442302,
|
|
|
|
footer: {
|
2022-04-21 23:44:02 -05:00
|
|
|
icon_url: user.displayAvatarURL(),
|
2022-04-21 18:09:21 -05:00
|
|
|
text: config.footerTxt
|
2022-03-21 10:28:55 -05:00
|
|
|
},
|
2022-04-21 18:09:21 -05:00
|
|
|
thumbnail: {
|
2022-04-21 23:44:02 -05:00
|
|
|
url: target.displayAvatarURL()
|
2022-03-21 10:28:55 -05:00
|
|
|
},
|
2022-04-21 18:09:21 -05:00
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
name: 'Username',
|
2022-04-21 23:44:02 -05:00
|
|
|
value: target.user.username,
|
2022-04-21 18:09:21 -05:00
|
|
|
inline: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Discriminator',
|
2022-04-21 23:44:02 -05:00
|
|
|
value: target.user.discriminator,
|
2022-04-21 18:09:21 -05:00
|
|
|
inline: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Full Username',
|
2022-04-21 23:44:02 -05:00
|
|
|
value: target.user.tag,
|
2022-04-21 18:09:21 -05:00
|
|
|
inline: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'User Profile Picture',
|
2022-04-21 23:44:02 -05:00
|
|
|
value: target.user.displayAvatarURL()
|
2022-04-21 18:09:21 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'User Status',
|
2022-04-21 23:44:02 -05:00
|
|
|
value: target.presence?.status ?? (config.intents.includes('GUILD_PRESENCES') ? 'Offline' : 'Missing GUILD_PRESENCES intent')
|
2022-04-21 18:09:21 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'User ID',
|
2022-04-21 23:44:02 -05:00
|
|
|
value: `\`${target.user.id}\``
|
2022-04-21 18:09:21 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'User Joined Discord',
|
2022-04-21 23:44:02 -05:00
|
|
|
value: target.user.createdAt.toString(),
|
2022-04-21 18:09:21 -05:00
|
|
|
inline: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}]
|
2022-04-21 23:44:02 -05:00
|
|
|
};
|
2022-03-21 10:28:55 -05:00
|
|
|
}
|
2022-04-21 18:09:21 -05:00
|
|
|
};
|