updated profile and centralized functions
This commit is contained in:
+2
-30
@@ -13,7 +13,7 @@ const {
|
||||
} = require("./cookieEconomy");
|
||||
|
||||
const {
|
||||
trackProfileEvent
|
||||
recordGameOutcome
|
||||
} = require("./profileSystem");
|
||||
|
||||
const SLOT_BETS = [
|
||||
@@ -308,12 +308,10 @@ async function playSlots(
|
||||
const profit =
|
||||
payout - bet;
|
||||
|
||||
await trackProfileEvent(
|
||||
await recordGameOutcome(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type:
|
||||
"game_result",
|
||||
game:
|
||||
"slots",
|
||||
result:
|
||||
@@ -331,32 +329,6 @@ async function playSlots(
|
||||
}
|
||||
);
|
||||
|
||||
if (profit > 0) {
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type:
|
||||
"cookie_gain",
|
||||
amount:
|
||||
profit
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
else if (profit < 0) {
|
||||
await trackProfileEvent(
|
||||
interaction,
|
||||
playerId,
|
||||
{
|
||||
type:
|
||||
"cookie_loss",
|
||||
amount:
|
||||
Math.abs(profit)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const resultEmbed =
|
||||
new EmbedBuilder()
|
||||
.setTitle(
|
||||
|
||||
Reference in New Issue
Block a user