Improved locales, added /language
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Module that provides all database columns"""
|
||||
|
||||
from pymongo import MongoClient
|
||||
from async_pymongo import AsyncClient
|
||||
from ujson import loads
|
||||
|
||||
with open("config.json", "r", encoding="utf-8") as f:
|
||||
@@ -20,14 +20,15 @@ else:
|
||||
db_config["host"], db_config["port"], db_config["name"]
|
||||
)
|
||||
|
||||
db_client = MongoClient(con_string)
|
||||
db_client = AsyncClient(con_string)
|
||||
db = db_client.get_database(name=db_config["name"])
|
||||
|
||||
collections = db.list_collection_names()
|
||||
# collections = db.list_collection_names()
|
||||
|
||||
for collection in ["users", "schedule"]:
|
||||
if collection not in collections:
|
||||
db.create_collection(collection)
|
||||
# for collection in ["users", "groups", "schedule"]:
|
||||
# if collection not in collections:
|
||||
# db.create_collection(collection)
|
||||
|
||||
col_users = db.get_collection("users")
|
||||
col_groups = db.get_collection("groups")
|
||||
col_schedule = db.get_collection("schedule")
|
||||
|
Reference in New Issue
Block a user