64 lines
1.3 KiB
JavaScript
64 lines
1.3 KiB
JavaScript
const {
|
|
SlashCommandBuilder
|
|
} = require(
|
|
"discord.js"
|
|
);
|
|
|
|
const {
|
|
buildProfileOverview,
|
|
buildProfileButtons
|
|
} = 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;
|
|
|
|
const sessionOwnerId =
|
|
interaction.user.id;
|
|
|
|
const embed =
|
|
await buildProfileOverview(
|
|
interaction.guildId,
|
|
user,
|
|
sessionOwnerId
|
|
);
|
|
|
|
return interaction.reply({
|
|
embeds: [embed],
|
|
components:
|
|
buildProfileButtons(
|
|
"overview",
|
|
0,
|
|
1
|
|
)
|
|
});
|
|
}
|
|
};
|