diff --git a/bots/modules/cyberlina.py b/bots/modules/cyberlina.py index 9f62227..7f8627c 100644 --- a/bots/modules/cyberlina.py +++ b/bots/modules/cyberlina.py @@ -6,7 +6,7 @@ from uuid import uuid4 import humanize import markovify from django.db import models -from django.utils.timezone import localdate, now, make_aware +from django.utils.timezone import localdate, now, make_aware, localtime from jsoneditor.forms import JSONEditor from jsonfield import JSONField from telegram import Update, Chat, User, InlineQueryResultArticle, InputTextMessageContent @@ -61,7 +61,7 @@ class CyberLinaBotModuleConfig(TelegramBotModuleConfig): self.message_handler(update, ctx) chat = self.chats.get(chat_id=update.effective_chat.id) if chat.last_run and (chat.last_run >= localdate() or - chat.last_run + timedelta(1) == localdate() and now().hour < 6): + chat.last_run + timedelta(1) == localdate() and localtime().hour < 6): humanize.i18n.activate('ru_RU') time_left = make_aware(datetime.combine(chat.last_run + timedelta(1), time(6, 0))) - now() return update.effective_message.reply_text(