Починил время отправки сообщений, расширил список мотивирующих цитат
This commit is contained in:
1107
src/quotes.json
1107
src/quotes.json
File diff suppressed because it is too large
Load Diff
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user