This commit closes #11
This commit is contained in:
@@ -3,6 +3,7 @@ from dataclasses import dataclass
|
||||
from typing import Union
|
||||
|
||||
from bson import ObjectId
|
||||
from libbot import sync
|
||||
from pyrogram.types import User
|
||||
|
||||
from classes.pyroclient import PyroClient
|
||||
@@ -26,8 +27,8 @@ class PyroGroup:
|
||||
async def create_if_not_exists(
|
||||
cls,
|
||||
id: int,
|
||||
locale: Union[str, None] = None,
|
||||
locale_auto: bool = True,
|
||||
locale: Union[str, None] = sync.config_get("locale", "defaults", "group"),
|
||||
locale_auto: bool = sync.config_get("locale_auto", "defaults", "group"),
|
||||
):
|
||||
db_entry = await col_groups.find_one(
|
||||
{
|
||||
@@ -37,7 +38,11 @@ class PyroGroup:
|
||||
|
||||
if db_entry is None:
|
||||
inserted = await col_groups.insert_one(
|
||||
{"id": id, "locale": locale, "locale_auto": locale_auto}
|
||||
{
|
||||
"id": id,
|
||||
"locale": locale,
|
||||
"locale_auto": locale_auto,
|
||||
}
|
||||
)
|
||||
db_entry = await col_groups.find_one({"_id": inserted.inserted_id})
|
||||
|
||||
|
Reference in New Issue
Block a user