TSS storage (#1233)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Entry point for TSSBOT. Connects to Discord and idles until commands land."""
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
import signal
|
||||
@@ -17,6 +18,9 @@ from dotenv import load_dotenv
|
||||
|
||||
load_dotenv(dotenv_path=_HERE / ".env")
|
||||
|
||||
# Imported after load_dotenv so STORAGE_VOL_PATH is read from .env.
|
||||
from BOT.storage import init_tss_dbs # noqa: E402
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="[%(asctime)s] [%(levelname)s] [tssbot] %(message)s",
|
||||
@@ -54,4 +58,9 @@ if __name__ == "__main__":
|
||||
if not TOKEN:
|
||||
log.error("DISCORD_KEY not set in TSSBOT/.env — aborting")
|
||||
sys.exit(1)
|
||||
try:
|
||||
asyncio.run(init_tss_dbs())
|
||||
except Exception as e:
|
||||
log.error(f"failed to initialise TSS databases: {e}")
|
||||
sys.exit(1)
|
||||
bot.run(TOKEN, log_handler=None)
|
||||
|
||||
Reference in New Issue
Block a user