From 2882688ff43dc8093fbe89a8cf8dc78c34977fc5 Mon Sep 17 00:00:00 2001 From: Sergey Elpashev Date: Thu, 26 Dec 2024 14:08:45 +0300 Subject: [PATCH] Feat: added time field --- main.py | 4 ++-- nwxraybot/models/user.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index ebb0f48..b4c0cf4 100644 --- a/main.py +++ b/main.py @@ -13,13 +13,13 @@ if __name__ == "__main__": config = Settings() # Load config from .env logging.basicConfig(level=logging.DEBUG if config.debug else logging.INFO) - print(config.postgres_url) - # Check if bot token is set if config.bot_token == 'token': logging.error("Bot token is not set") exit(1) + User.create_table() + # Start bot bot = Bot(token=config.bot_token.get_secret_value()) dp = Dispatcher() diff --git a/nwxraybot/models/user.py b/nwxraybot/models/user.py index df8dce8..67c1f5e 100644 --- a/nwxraybot/models/user.py +++ b/nwxraybot/models/user.py @@ -11,6 +11,7 @@ class User(Model): id = PrimaryKeyField() name = CharField() url = CharField() + time = DateTimeField(null=True) class Meta: database = db