2022-08-04 19:26:17 +05:00
|
|
|
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
|
|
|
const BaseCommand = require("../../base/BaseCommand");
|
|
|
|
|
|
|
|
class Userinfo extends BaseCommand {
|
|
|
|
/**
|
|
|
|
*
|
2023-11-05 16:03:23 +05:00
|
|
|
* @param {import("../base/Client")} client
|
2022-08-04 19:26:17 +05:00
|
|
|
*/
|
|
|
|
constructor(client) {
|
|
|
|
super({
|
|
|
|
command: new SlashCommandBuilder()
|
|
|
|
.setName("userinfo")
|
|
|
|
.setDescription(client.translate("general/userinfo:DESCRIPTION"))
|
2023-06-15 19:46:27 +05:00
|
|
|
.setDescriptionLocalizations({
|
2023-07-05 00:58:06 +05:00
|
|
|
uk: client.translate("general/userinfo:DESCRIPTION", null, "uk-UA"),
|
|
|
|
ru: client.translate("general/userinfo:DESCRIPTION", null, "ru-RU"),
|
2023-06-15 19:46:27 +05:00
|
|
|
})
|
2022-10-13 00:05:36 +05:00
|
|
|
.setDMPermission(false)
|
2023-07-05 00:58:06 +05:00
|
|
|
.addUserOption(option =>
|
|
|
|
option
|
|
|
|
.setName("user")
|
|
|
|
.setDescription(client.translate("common:USER"))
|
|
|
|
.setDescriptionLocalizations({
|
|
|
|
uk: client.translate("common:USER", null, "uk-UA"),
|
|
|
|
ru: client.translate("common:USER", null, "ru-RU"),
|
|
|
|
}),
|
|
|
|
),
|
2022-08-04 19:26:17 +05:00
|
|
|
aliases: [],
|
|
|
|
dirname: __dirname,
|
2022-12-15 21:02:38 +05:00
|
|
|
ownerOnly: false,
|
2022-08-04 19:26:17 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
2023-11-05 16:03:23 +05:00
|
|
|
* @param {import("../../base/Client")} client
|
2022-08-04 19:26:17 +05:00
|
|
|
*/
|
|
|
|
async onLoad() {
|
|
|
|
//...
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
2023-11-05 16:03:23 +05:00
|
|
|
* @param {import("../../base/Client")} client
|
2022-08-04 19:26:17 +05:00
|
|
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
2022-08-09 23:48:33 +05:00
|
|
|
* @param {Object} data
|
2022-08-04 19:26:17 +05:00
|
|
|
*/
|
2023-12-14 18:58:19 +05:00
|
|
|
async execute(client, interaction) {
|
2022-08-04 19:26:17 +05:00
|
|
|
const member = interaction.options.getMember("user") || interaction.member;
|
|
|
|
const embed = new EmbedBuilder()
|
|
|
|
.setAuthor({
|
2023-07-03 14:25:25 +05:00
|
|
|
name: `${member.user.getUsername()} (${member.id})`,
|
2022-12-15 21:02:38 +05:00
|
|
|
iconURL: member.displayAvatarURL(),
|
2022-08-04 19:26:17 +05:00
|
|
|
})
|
2023-07-05 00:58:06 +05:00
|
|
|
.setThumbnail(
|
|
|
|
member.displayAvatarURL({
|
|
|
|
size: 512,
|
|
|
|
}),
|
|
|
|
)
|
2022-08-04 19:26:17 +05:00
|
|
|
.addFields([
|
|
|
|
{
|
|
|
|
name: ":man: " + interaction.translate("common:USERNAME"),
|
2023-07-03 14:25:25 +05:00
|
|
|
value: member.user.getUsername(),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
2022-08-04 19:26:17 +05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: client.customEmojis.pencil + " " + interaction.translate("common:NICKNAME"),
|
|
|
|
value: member.nickname || interaction.translate("general/userinfo:NO_NICKNAME"),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
2022-08-04 19:26:17 +05:00
|
|
|
},
|
2023-04-12 23:26:07 +05:00
|
|
|
// {
|
|
|
|
// name: client.customEmojis.status[member.presence.status] + " " + interaction.translate("common:STATUS"),
|
|
|
|
// value: interaction.translate(`common:STATUS_${member.presence.status.toUpperCase()}`),
|
|
|
|
// inline: true,
|
|
|
|
// },
|
2022-08-04 19:26:17 +05:00
|
|
|
{
|
|
|
|
name: client.customEmojis.bot + " " + interaction.translate("common:ROBOT"),
|
|
|
|
value: member.user.bot ? interaction.translate("common:YES") : interaction.translate("common:NO"),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
2022-08-04 19:26:17 +05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: client.customEmojis.calendar + " " + interaction.translate("common:CREATION"),
|
2023-12-14 18:58:19 +05:00
|
|
|
value: client.functions.printDate(client, member.user.createdAt, null, interaction.getLocale()),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
2022-08-04 19:26:17 +05:00
|
|
|
},
|
|
|
|
{
|
2022-08-09 23:48:33 +05:00
|
|
|
name: client.customEmojis.calendar2 + " " + interaction.translate("common:JOINED"),
|
2023-12-14 18:58:19 +05:00
|
|
|
value: client.functions.printDate(client, member.joinedAt, null, interaction.getLocale()),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
2022-08-04 19:26:17 +05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: client.customEmojis.color + " " + interaction.translate("common:COLOR"),
|
|
|
|
value: member.displayHexColor,
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
2022-08-04 19:26:17 +05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: client.customEmojis.roles + " " + interaction.translate("common:ROLES"),
|
2023-07-05 00:58:06 +05:00
|
|
|
value:
|
|
|
|
member.roles.size > 10
|
|
|
|
? member.roles.cache.map(r => r).filter(r => r.id !== interaction.guild.roles.everyone.id).slice(0, 10).join(", ") + " " +
|
|
|
|
interaction.translate("general/userinfo:MORE_ROLES", {
|
|
|
|
count: member.roles.cache.size - 10,
|
|
|
|
})
|
|
|
|
: member.roles.cache.size < 1 ? interaction.translate("general/userinfo:NO_ROLE") : member.roles.cache.map(r => r).filter(r => r.id !== interaction.guild.roles.everyone.id).slice(0, 10).join(", "),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
|
|
|
},
|
2022-08-04 19:26:17 +05:00
|
|
|
])
|
|
|
|
.setColor(client.config.embed.color)
|
2023-07-07 21:13:11 +05:00
|
|
|
.setFooter(client.config.embed.footer);
|
2022-08-04 19:26:17 +05:00
|
|
|
|
2023-04-12 23:26:44 +05:00
|
|
|
/*
|
2022-09-04 19:04:43 +05:00
|
|
|
if (member.presence.activities[0]?.name === "Custom Status") {
|
2022-08-04 19:26:17 +05:00
|
|
|
embed.addFields([
|
|
|
|
{
|
|
|
|
name: client.customEmojis.games + " " + interaction.translate("common:ACTIVITY"),
|
|
|
|
value: member.presence.activities[0] ? `${interaction.translate("general/userinfo:CUSTOM")}\n${member.presence.activities[0].state || interaction.translate("common:NOT_DEFINED")}` : interaction.translate("general/userinfo:NO_ACTIVITY"),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
|
|
|
},
|
2022-08-04 19:26:17 +05:00
|
|
|
]);
|
|
|
|
} else {
|
|
|
|
embed.addFields([
|
|
|
|
{
|
|
|
|
name: client.customEmojis.games + " " + interaction.translate("common:ACTIVITY"),
|
2022-09-04 19:04:43 +05:00
|
|
|
value: member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : interaction.translate("general/userinfo:NO_ACTIVITY"),
|
2022-12-15 21:02:38 +05:00
|
|
|
inline: true,
|
|
|
|
},
|
2022-08-04 19:26:17 +05:00
|
|
|
]);
|
2023-04-12 23:26:44 +05:00
|
|
|
} */
|
2022-08-04 19:26:17 +05:00
|
|
|
|
|
|
|
interaction.reply({
|
2022-12-15 21:02:38 +05:00
|
|
|
embeds: [embed],
|
2022-08-04 19:26:17 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 00:58:06 +05:00
|
|
|
module.exports = Userinfo;
|