updated profile and centralized functions
This commit is contained in:
+2
-30
@@ -18,7 +18,7 @@ const {
|
||||
} = require("./cookieEconomy");
|
||||
|
||||
const {
|
||||
trackProfileEvent
|
||||
recordGameOutcome
|
||||
} = require("./profileSystem");
|
||||
|
||||
const GAME_COLLECTION =
|
||||
@@ -929,12 +929,10 @@ async function finishBlackjack(
|
||||
profileResult = "loss";
|
||||
}
|
||||
|
||||
await trackProfileEvent(
|
||||
await recordGameOutcome(
|
||||
interaction,
|
||||
game.userId,
|
||||
{
|
||||
type:
|
||||
"game_result",
|
||||
game:
|
||||
"blackjack",
|
||||
result:
|
||||
@@ -949,32 +947,6 @@ async function finishBlackjack(
|
||||
}
|
||||
);
|
||||
|
||||
if (profit > 0) {
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
game.userId,
|
||||
{
|
||||
type:
|
||||
"cookie_gain",
|
||||
amount:
|
||||
profit
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
else if (profit < 0) {
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
game.userId,
|
||||
{
|
||||
type:
|
||||
"cookie_loss",
|
||||
amount:
|
||||
Math.abs(profit)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const description = [
|
||||
"**Dealer**",
|
||||
formatCards(
|
||||
|
||||
Reference in New Issue
Block a user