From 11dbf3239d83c8d1939a1ff1902f20a7591840b1 Mon Sep 17 00:00:00 2001 From: profitroll Date: Wed, 28 Jun 2023 10:52:00 +0200 Subject: [PATCH] Removed deprecated collection --- modules/database.py | 5 ++--- plugins/handlers/submission.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/database.py b/modules/database.py index dbfa7df..acdb504 100644 --- a/modules/database.py +++ b/modules/database.py @@ -25,11 +25,10 @@ db = db_client.get_database(name=db_config["name"]) collections = db.list_collection_names() -for collection in ["sent", "users", "banned", "submitted"]: - if not collection in collections: +for collection in ["sent", "users", "submitted"]: + if collection not in collections: db.create_collection(collection) col_sent = db.get_collection("sent") col_users = db.get_collection("users") -col_banned = db.get_collection("banned") col_submitted = db.get_collection("submitted") diff --git a/plugins/handlers/submission.py b/plugins/handlers/submission.py index 74159f9..3206c85 100644 --- a/plugins/handlers/submission.py +++ b/plugins/handlers/submission.py @@ -13,7 +13,7 @@ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from classes.enums.submission_types import SubmissionType from classes.exceptions import SubmissionDuplicatesError, SubmissionUnsupportedError from classes.pyroclient import PyroClient -from modules.database import col_banned, col_submitted +from modules.database import col_submitted from modules.utils import USERS_WITH_CONTEXT logger = logging.getLogger(__name__) @@ -38,7 +38,7 @@ async def get_submission(app: PyroClient, msg: Message): user_owner = await app.find_user(app.owner) try: - if col_banned.find_one({"user": msg.from_user.id}) is not None: + if user.banned: return await app.send_chat_action(msg.chat.id, ChatAction.TYPING)