added new logic to the new rewards

This commit is contained in:
DeSqBlocki
2026-08-23 00:43:43 +02:00
parent 4d858554be
commit 425686ec40
15 changed files with 1644 additions and 2662 deletions
+39 -36
View File
@@ -1,51 +1,54 @@
const {
requireProfileOwner,
buildAchievementsEmbed,
buildProfileButtons,
buildProfilePaginationButtons
} = require("../../utils/profileSystem");
getProfileContextFromFooter,
requireProfileOwner
} = require(
"../../utils/profileSystem"
);
module.exports = {
name: "profileAchievements",
name:
"profileAchievements",
async execute(interaction) {
const session = await requireProfileOwner(
interaction
);
async execute(
interaction
) {
const context =
await requireProfileOwner(
interaction
);
if (!session) {
if (!context) {
return;
}
const user = await interaction.client.users.fetch(
session.profileUserId
);
const result = await buildAchievementsEmbed(
interaction.guildId,
user,
0,
session.sessionOwnerId
);
const components = [
...buildProfileButtons()
];
if (result.pageCount > 1) {
components.push(
buildProfilePaginationButtons(
"profileAchievementsLeft",
"profileAchievementsRight",
result.page,
result.pageCount
)
const user =
await interaction.client.users.fetch(
context.profileUserId
);
const embed =
await buildAchievementsEmbed(
interaction.guildId,
user,
context.sessionOwnerId,
0
);
const pageContext =
getProfileContextFromFooter(
embed.data.footer?.text
);
}
return interaction.update({
embeds: [result.embed],
components
embeds: [embed],
components:
buildProfileButtons(
"achievements",
pageContext?.page ?? 0,
pageContext?.pageCount ?? 1
)
});
}
};
};