48 lines
941 B
JavaScript
48 lines
941 B
JavaScript
const {
|
|
buildProfileOverview,
|
|
buildProfileButtons,
|
|
requireProfileOwner
|
|
} = require(
|
|
"../../utils/profileSystem"
|
|
);
|
|
|
|
module.exports = {
|
|
name:
|
|
"profileOverview",
|
|
|
|
async execute(
|
|
interaction
|
|
) {
|
|
const context =
|
|
await requireProfileOwner(
|
|
interaction
|
|
);
|
|
|
|
if (!context) {
|
|
return;
|
|
}
|
|
|
|
const user =
|
|
await interaction.client.users.fetch(
|
|
context.profileUserId
|
|
);
|
|
|
|
const embed =
|
|
await buildProfileOverview(
|
|
interaction.guildId,
|
|
user,
|
|
context.sessionOwnerId
|
|
);
|
|
|
|
return interaction.update({
|
|
embeds: [embed],
|
|
components:
|
|
buildProfileButtons(
|
|
"overview",
|
|
0,
|
|
1
|
|
)
|
|
});
|
|
}
|
|
};
|