profile update with badges and achievements

This commit is contained in:
DeSqBlocki
2026-08-22 20:27:42 +02:00
parent c630543f9e
commit e437c051b9
7 changed files with 542 additions and 1441 deletions
+87
View File
@@ -18,6 +18,10 @@ const {
formatPercentage
} = require("../../utils/cookieEconomy");
const {
trackProfileEvent
} = require("../../utils/profileSystem");
const COLLECT_COOLDOWN =
60 * 60;
@@ -214,6 +218,15 @@ async function collect(interaction) {
amount
);
await trackProfileEvent(
interaction,
userId,
{
type: "cookie_gain",
amount
}
);
const nextCollect =
await setCooldown(
@@ -456,6 +469,44 @@ async function steal(interaction) {
}
await trackProfileEvent(
interaction,
user.id,
{
type: "steal_success",
amount,
targetUserId: target.id
}
);
await trackProfileEvent(
interaction,
user.id,
{
type: "cookie_gain",
amount
}
);
await trackProfileEvent(
interaction,
target.id,
{
type: "stolen_from_me",
amount,
thiefUserId: user.id
}
);
await trackProfileEvent(
interaction,
target.id,
{
type: "cookie_loss",
amount
}
);
const [
yourBalanceAfter,
targetBalanceAfter
@@ -605,6 +656,24 @@ async function steal(interaction) {
}
await trackProfileEvent(
interaction,
user.id,
{
type: "cookie_loss",
amount: penalty
}
);
await trackProfileEvent(
interaction,
target.id,
{
type: "cookie_gain",
amount: penalty
}
);
const [
yourBalanceAfter,
targetBalanceAfter
@@ -851,6 +920,24 @@ async function give(interaction) {
}
await trackProfileEvent(
interaction,
user.id,
{
type: "cookies_given",
amount
}
);
await trackProfileEvent(
interaction,
target.id,
{
type: "cookie_gain",
amount
}
);
const [
yourBalance,
theirBalance