snapshot_poker_phase5
This commit is contained in:
@@ -6,6 +6,12 @@ const {
|
||||
refreshPokerTableMessage
|
||||
} = require("../utils/pokerDiscord");
|
||||
|
||||
const {
|
||||
announcePokerHandProgress,
|
||||
createPokerProfileContext,
|
||||
recordPokerHandProfiles
|
||||
} = require("../utils/pokerProfile");
|
||||
|
||||
|
||||
const TURN_CHECK_INTERVAL =
|
||||
5 * 1000;
|
||||
@@ -91,6 +97,39 @@ async function processPokerTurns(
|
||||
client,
|
||||
result
|
||||
);
|
||||
|
||||
if (
|
||||
result.game
|
||||
?.data
|
||||
?.hand
|
||||
?.state ===
|
||||
"PAYOUT"
|
||||
) {
|
||||
try {
|
||||
await recordPokerHandProfiles(
|
||||
result.game
|
||||
);
|
||||
|
||||
const context =
|
||||
await createPokerProfileContext(
|
||||
client,
|
||||
result.game
|
||||
);
|
||||
|
||||
if (context) {
|
||||
await announcePokerHandProgress(
|
||||
context,
|
||||
result.game
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
console.error(
|
||||
`[PokerProfile] Timeout profile processing failed for ${result.game.gameId}:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,6 +208,28 @@ async function recoverPoker(
|
||||
client,
|
||||
game
|
||||
);
|
||||
|
||||
if (
|
||||
game.data?.hand?.state ===
|
||||
"PAYOUT"
|
||||
) {
|
||||
await recordPokerHandProfiles(
|
||||
game
|
||||
);
|
||||
|
||||
const context =
|
||||
await createPokerProfileContext(
|
||||
client,
|
||||
game
|
||||
);
|
||||
|
||||
if (context) {
|
||||
await announcePokerHandProgress(
|
||||
context,
|
||||
game
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
console.error(
|
||||
|
||||
Reference in New Issue
Block a user