Small config reading fix
This commit is contained in:
parent
176f5d35c3
commit
235fa37252
@ -1,11 +1,9 @@
|
|||||||
"""Module that provides all database columns"""
|
"""Module that provides all database columns"""
|
||||||
|
|
||||||
from async_pymongo import AsyncClient
|
from async_pymongo import AsyncClient
|
||||||
from ujson import loads
|
from libbot import sync
|
||||||
|
|
||||||
with open("config.json", "r", encoding="utf-8") as f:
|
db_config = sync.config_get("database")
|
||||||
db_config = loads(f.read())["database"]
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
if db_config["user"] is not None and db_config["password"] is not None:
|
if db_config["user"] is not None and db_config["password"] is not None:
|
||||||
con_string = "mongodb://{0}:{1}@{2}:{3}/{4}".format(
|
con_string = "mongodb://{0}:{1}@{2}:{3}/{4}".format(
|
||||||
|
Reference in New Issue
Block a user