Починил время отправки сообщений, расширил список мотивирующих цитат

This commit is contained in:
Zwuck
2025-12-17 10:58:57 +05:00
parent fdf78b92ef
commit 0269e62f16
2 changed files with 1072 additions and 38 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,8 @@ export class SchedulerService {
const diffMs = now.getTime() - lastSent.getTime(); const diffMs = now.getTime() - lastSent.getTime();
const diffHours = diffMs / (1000 * 60 * 60); const diffHours = diffMs / (1000 * 60 * 60);
if (diffHours >= user.frequency) { // Allow 3 minutes tolerance (0.05 hours) for cron execution delays
if (diffHours >= user.frequency - 0.05) {
await this.sendQuote(user); await this.sendQuote(user);
// Updating user lastQuoteSentAt to now // Updating user lastQuoteSentAt to now
// Update expects telegramId. user.telegramId is BigInt. // Update expects telegramId. user.telegramId is BigInt.