Removed deprecated collection

This commit is contained in:
Profitroll 2023-06-28 10:52:00 +02:00
parent 3d87f035e7
commit 11dbf3239d
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
2 changed files with 4 additions and 5 deletions

View File

@ -25,11 +25,10 @@ db = db_client.get_database(name=db_config["name"])
collections = db.list_collection_names() collections = db.list_collection_names()
for collection in ["sent", "users", "banned", "submitted"]: for collection in ["sent", "users", "submitted"]:
if not collection in collections: if collection not in collections:
db.create_collection(collection) db.create_collection(collection)
col_sent = db.get_collection("sent") col_sent = db.get_collection("sent")
col_users = db.get_collection("users") col_users = db.get_collection("users")
col_banned = db.get_collection("banned")
col_submitted = db.get_collection("submitted") col_submitted = db.get_collection("submitted")

View File

@ -13,7 +13,7 @@ from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
from classes.enums.submission_types import SubmissionType from classes.enums.submission_types import SubmissionType
from classes.exceptions import SubmissionDuplicatesError, SubmissionUnsupportedError from classes.exceptions import SubmissionDuplicatesError, SubmissionUnsupportedError
from classes.pyroclient import PyroClient 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 from modules.utils import USERS_WITH_CONTEXT
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -38,7 +38,7 @@ async def get_submission(app: PyroClient, msg: Message):
user_owner = await app.find_user(app.owner) user_owner = await app.find_user(app.owner)
try: try:
if col_banned.find_one({"user": msg.from_user.id}) is not None: if user.banned:
return return
await app.send_chat_action(msg.chat.id, ChatAction.TYPING) await app.send_chat_action(msg.chat.id, ChatAction.TYPING)