mirror of
https://github.com/civsocit/olgram.git
synced 2023-07-22 01:29:12 +03:00
logging print datetime
This commit is contained in:
parent
fa2f3f9037
commit
4b62762c13
@ -105,7 +105,8 @@ class ServerSettings(AbstractSettings):
|
|||||||
return int(timedelta(days=1).total_seconds() * 1000.0)
|
return int(timedelta(days=1).total_seconds() * 1000.0)
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=os.environ.get("LOGLEVEL", "WARNING"))
|
logging.basicConfig(level=os.environ.get("LOGLEVEL", "WARNING"),
|
||||||
|
format='%(asctime)s %(levelname)-8s %(message)s')
|
||||||
|
|
||||||
|
|
||||||
class BotSettings(AbstractSettings):
|
class BotSettings(AbstractSettings):
|
||||||
|
@ -131,6 +131,8 @@ async def handle_user_message(message: types.Message, super_chat_id: int, bot):
|
|||||||
await send_to_superchat(is_super_group, message, super_chat_id, bot)
|
await send_to_superchat(is_super_group, message, super_chat_id, bot)
|
||||||
except (exceptions.Unauthorized, exceptions.ChatNotFound):
|
except (exceptions.Unauthorized, exceptions.ChatNotFound):
|
||||||
return SendMessage(chat_id=message.chat.id, text=_("Не удаётся связаться с владельцем бота"))
|
return SendMessage(chat_id=message.chat.id, text=_("Не удаётся связаться с владельцем бота"))
|
||||||
|
except exceptions.MessageToForwardNotFound:
|
||||||
|
_logger.error("(exception) Message to forward not found")
|
||||||
|
|
||||||
bot.incoming_messages_count = F("incoming_messages_count") + 1
|
bot.incoming_messages_count = F("incoming_messages_count") + 1
|
||||||
await bot.save(update_fields=["incoming_messages_count"])
|
await bot.save(update_fields=["incoming_messages_count"])
|
||||||
|
Loading…
Reference in New Issue
Block a user