35 lines
869 B
JavaScript
35 lines
869 B
JavaScript
const { SlashCommandBuilder } = require("discord.js");
|
|
|
|
const {
|
|
buildProfileOverview,
|
|
buildProfileButtons,
|
|
ensureGuildBadges
|
|
} = require("../../utils/profileSystem");
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName("profile")
|
|
.setDescription("View a player profile")
|
|
.addUserOption(option =>
|
|
option
|
|
.setName("user")
|
|
.setDescription("Player to view")
|
|
),
|
|
|
|
async execute(interaction) {
|
|
const user = interaction.options.getUser("user") ?? interaction.user;
|
|
|
|
await ensureGuildBadges(interaction.guildId);
|
|
|
|
const embed = await buildProfileOverview(
|
|
interaction.guildId,
|
|
user
|
|
);
|
|
|
|
return interaction.reply({
|
|
embeds: [embed],
|
|
components: buildProfileButtons()
|
|
});
|
|
}
|
|
};
|