diff --git a/megadl/helpers/mclient.py b/megadl/helpers/mclient.py index 45c7eb68..b26d375f 100644 --- a/megadl/helpers/mclient.py +++ b/megadl/helpers/mclient.py @@ -78,7 +78,7 @@ def __init__(self): # other stuff print("> Setting up additional functions") - self.add_handler(MessageHandler(self.ilistner)) + self.add_handler(MessageHandler(self.use_listner)) self.tasks = {} print("--------------------") @@ -90,7 +90,6 @@ def handle_checks(self, func: Callable) -> Callable: """ async def fn_run(client: Client, msg: Message): - print("oo") try: # db functions if self.database: @@ -127,7 +126,7 @@ async def ask(self, chat_id: int, text: str, *args, **kwargs): self.tasks.pop(chat_id, None) return None - async def ilistner(self, _, msg: Message): + async def use_listner(self, _, msg: Message): lstn = self.tasks.get(msg.chat.id) if lstn and not lstn["task"].done(): print(msg.text) diff --git a/megadl/lib/aiomongo.py b/megadl/lib/aiomongo.py index 1a1a2b5c..4bf79d7a 100644 --- a/megadl/lib/aiomongo.py +++ b/megadl/lib/aiomongo.py @@ -1,5 +1,5 @@ from os import getenv -from typing import Any, Optional, Sequence, Type, Union +from typing import Any from bson.codec_options import TypeRegistry from pymongo.collection import Collection from pymongo.mongo_client import MongoClient diff --git a/megadl/modules/mega_dl.py b/megadl/modules/mega_dl.py index af444e67..968adabd 100644 --- a/megadl/modules/mega_dl.py +++ b/megadl/modules/mega_dl.py @@ -56,6 +56,7 @@ async def dl_from_cb(client: MeganzClient, query: CallbackQuery): "Your download is starting 📥...", reply_markup=None ) + # weird workaround to add support for private mode conf = None if client.is_public: udoc = await client.database.is_there(qcid) diff --git a/megadl/modules/mega_up.py b/megadl/modules/mega_up.py index 46c62800..b2b0cd40 100644 --- a/megadl/modules/mega_up.py +++ b/megadl/modules/mega_up.py @@ -68,6 +68,7 @@ async def to_up_cb(client: MeganzClient, query: CallbackQuery): dl_path = await dl.download(msg.text, client.dl_loc, client, (qcid, qmid)) # Upload the file + # weird workaround to add support for private mode conf = None if client.is_public: udoc = await client.database.is_there(qcid)