This commit is contained in:
Soenke committed 2026-09-22 23:46:31 +02:00
1 parent 928b1f3893
commit 704d590a42
2 files changed
+6 -6

No files matched your search

+5 -1
View File
@@ -1,12 +1,16 @@
import os
import aiosqlite import aiosqlite
DB_PATH = "SQLite/FemBot.db"
class Database: class Database:
def __init__(self): def __init__(self):
self.conn = None self.conn = None
async def connect(self): async def connect(self):
if self.conn is None: if self.conn is None:
self.conn = await aiosqlite.connect("SQLite/FemBot.db") os.makedirs(os.path.dirname(DB_PATH), exist_ok=True)
self.conn = await aiosqlite.connect(DB_PATH)
try: try:
await self.conn.executescript(""" await self.conn.executescript("""
+1 -5
View File
@@ -6,8 +6,4 @@ services:
env_file: env_file:
- .env - .env
volumes: volumes:
- .:/bot - .:/bot
- bot_data:/bot/SQLite
volumes:
bot_data: