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 -38
View File
@@ -1,53 +1,54 @@
// buttons/profile/badgesLeft.js
const {
requireProfileOwner,
buildBadgesEmbed,
buildProfileButtons,
buildProfilePaginationButtons
} = require("../../utils/profileSystem");
getProfileContextFromFooter,
requireProfileOwner
} = require(
"../../utils/profileSystem"
);
module.exports = {
name: "profileBadgesLeft",
name:
"profileBadgesLeft",
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 buildBadgesEmbed(
interaction.guildId,
user,
session.page - 1,
session.sessionOwnerId
);
const components = [
...buildProfileButtons()
];
if (result.pageCount > 1) {
components.push(
buildProfilePaginationButtons(
"profileBadgesLeft",
"profileBadgesRight",
result.page,
result.pageCount
)
const user =
await interaction.client.users.fetch(
context.profileUserId
);
const embed =
await buildBadgesEmbed(
interaction.guildId,
user,
context.sessionOwnerId,
context.page - 1
);
const pageContext =
getProfileContextFromFooter(
embed.data.footer?.text
);
}
return interaction.update({
embeds: [result.embed],
components
embeds: [embed],
components:
buildProfileButtons(
"badges",
pageContext?.page ?? 0,
pageContext?.pageCount ?? 1
)
});
}
};
};