feat: 当数据库不存在时初始化数据

This commit is contained in:
Ching 2024-10-13 21:49:55 +08:00
parent ad524a2864
commit b0a937beab
2 changed files with 3 additions and 2 deletions

View File

@ -48,6 +48,7 @@ def get_random_toot():
return random.choice(unsent_toots) if unsent_toots.exists() else None return random.choice(unsent_toots) if unsent_toots.exists() else None
def main(): def main():
if not Toot.table_exists():
create_table() create_table()
insert_toots() insert_toots()

0
toots123.db Normal file
View File