MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / updateWinnerStatus

Function updateWinnerStatus

lottery/lottery.ts:477–486  ·  view source on GitHub ↗
(winnerId: number, status: PrizeStatus, claimedAt?: number)

Source from the content-addressed store, hash-verified

475 `);
476 stmt.run(status, claimedAt || null, winnerId);
477}
478
479function updateWinnerStatusByUser(lotteryId: number, userId: string, status: PrizeStatus, claimedAt?: number): boolean {
480 if (!db) return false;
481
482 const stmt = db.prepare(`
483 UPDATE lottery_winners
484 SET status = ?, claimed_at = ?
485 WHERE lottery_id = ? AND user_id = ?
486 `);
487 const result = stmt.run(status, claimedAt || Date.now(), lotteryId, userId);
488 return result.changes > 0;
489}

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected