profile update with badges and achievements
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user