Fix reminder scheduling and add group features

- Fix reminder duplicate bug: use slot-only keys to prevent multiple reminders when settings change
- Add New Jackpot announcement delay setting for groups (default 5 min)
- Cancel unpaid purchases after draw completes (prevents payments for past rounds)
- Add BotFather commands template file
- Update README documentation
This commit is contained in:
Michilis
2025-12-08 23:49:54 +00:00
parent 13fd2b8989
commit 86e2e0a321
10 changed files with 366 additions and 51 deletions

View File

@@ -603,6 +603,7 @@ To buy tickets privately, message me directly! 🎟`,
reminder3Enabled?: boolean;
reminder3Time?: { value: number; unit: string };
announcementDelaySeconds?: number;
newJackpotDelayMinutes?: number;
}) => {
const announceDelay = settings.announcementDelaySeconds ?? 10;
const formatAnnounce = announceDelay === 0
@@ -610,6 +611,11 @@ To buy tickets privately, message me directly! 🎟`,
: announceDelay >= 60
? `${announceDelay / 60} min after draw`
: `${announceDelay}s after draw`;
const newJackpotDelay = settings.newJackpotDelayMinutes ?? 5;
const formatNewJackpotDelay = newJackpotDelay === 0
? 'Immediately'
: `${newJackpotDelay} min after start`;
// Format helper for reminder times
const formatTime = (t?: { value: number; unit: string }) => {
@@ -639,7 +645,7 @@ To buy tickets privately, message me directly! 🎟`,
*Current Configuration:*
${settings.enabled ? '✅' : '❌'} Bot Enabled
${newJackpot ? '✅' : '❌'} New Jackpot Announcements
${newJackpot ? '✅' : '❌'} New Jackpot Announcements ${newJackpot ? `_(${formatNewJackpotDelay})_` : ''}
${settings.drawAnnouncements ? '✅' : '❌'} Draw Announcements ${settings.drawAnnouncements ? `_(${formatAnnounce})_` : ''}
${settings.reminders ? '✅' : '❌'} Draw Reminders ${settings.reminders ? `_(${formatReminderList})_` : ''}
${settings.ticketPurchaseAllowed ? '✅' : '❌'} Ticket Purchases in Group