Feat: added time field
This commit is contained in:
4
main.py
4
main.py
@@ -13,13 +13,13 @@ if __name__ == "__main__":
|
|||||||
config = Settings() # Load config from .env
|
config = Settings() # Load config from .env
|
||||||
logging.basicConfig(level=logging.DEBUG if config.debug else logging.INFO)
|
logging.basicConfig(level=logging.DEBUG if config.debug else logging.INFO)
|
||||||
|
|
||||||
print(config.postgres_url)
|
|
||||||
|
|
||||||
# Check if bot token is set
|
# Check if bot token is set
|
||||||
if config.bot_token == 'token':
|
if config.bot_token == 'token':
|
||||||
logging.error("Bot token is not set")
|
logging.error("Bot token is not set")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
User.create_table()
|
||||||
|
|
||||||
# Start bot
|
# Start bot
|
||||||
bot = Bot(token=config.bot_token.get_secret_value())
|
bot = Bot(token=config.bot_token.get_secret_value())
|
||||||
dp = Dispatcher()
|
dp = Dispatcher()
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class User(Model):
|
|||||||
id = PrimaryKeyField()
|
id = PrimaryKeyField()
|
||||||
name = CharField()
|
name = CharField()
|
||||||
url = CharField()
|
url = CharField()
|
||||||
|
time = DateTimeField(null=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
database = db
|
database = db
|
||||||
|
|||||||
Reference in New Issue
Block a user