fix
This commit is contained in:
1 parent
928b1f3893
commit
704d590a42
2 files changed
+5
-5
No files matched your search
+5
-1
@@ -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("""
|
||||||
|
|||||||
@@ -7,7 +7,3 @@ services:
|
|||||||
- .env
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
- .:/bot
|
- .:/bot
|
||||||
- bot_data:/bot/SQLite
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
bot_data:
|
|
||||||
Reference in new issue
Block a user