updated badges

This commit is contained in:
DeSqBlocki
2026-08-22 22:46:40 +02:00
parent 9e0870c1ed
commit 08d1a8c5cd
11 changed files with 1047 additions and 261 deletions
+41 -9
View File
@@ -1,22 +1,54 @@
const {
buildBadgesEmbed,
buildProfileButtons,
getProfileTargetId
} = require("../../utils/profileSystem");
getProfileContextFromFooter,
requireProfileOwner
} = require(
"../../utils/profileSystem"
);
module.exports = {
name: "profileBadges",
name:
"profileBadges",
async execute(interaction) {
const userId = getProfileTargetId(interaction);
if (!userId) return;
async execute(
interaction
) {
const context =
await requireProfileOwner(
interaction
);
const user = await interaction.client.users.fetch(userId);
const embed = await buildBadgesEmbed(interaction.guildId, user);
if (!context) {
return;
}
const user =
await interaction.client.users.fetch(
context.profileUserId
);
const embed =
await buildBadgesEmbed(
interaction.guildId,
user,
context.sessionOwnerId,
0
);
const pageContext =
getProfileContextFromFooter(
embed.data.footer?.text
);
return interaction.update({
embeds: [embed],
components: buildProfileButtons()
components:
buildProfileButtons(
"badges",
pageContext?.page ?? 0,
pageContext?.pageCount ?? 1
)
});
}
};