Add storage, syncing db, rename module
This commit is contained in:
17
bot/modules/database/db.py
Normal file
17
bot/modules/database/db.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from .db_model import DBDict
|
||||
import os.path
|
||||
from bot.utils.config import config
|
||||
|
||||
DB = os.path.join(config.local.db_path, 'db')
|
||||
|
||||
if not os.path.isfile(DB):
|
||||
open('sync', 'w')
|
||||
|
||||
|
||||
class Db(object):
|
||||
def __init__(self):
|
||||
self.fsm = DBDict('fsm')
|
||||
self.config = DBDict('config')
|
||||
|
||||
async def write(self):
|
||||
await self.config.write()
|
||||
Reference in New Issue
Block a user