diff --git a/bot/__init__.py b/bot/__init__.py index a27b8c414711..b5810e1f5863 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -91,6 +91,7 @@ qb_torrents = {} jd_downloads = {} nzb_jobs = {} + drives_names = [] drives_ids = [] index_urls = [] @@ -99,6 +100,7 @@ "!qB" ] shorteneres_list = [] + extra_buttons = {} user_data = {} aria2_options = {} @@ -106,6 +108,7 @@ nzb_options = {} queued_dl = {} queued_up = {} + non_queued_dl = set() non_queued_up = set() multi_tags = set() @@ -125,6 +128,7 @@ cpu_eater_lock = Lock() subprocess_lock = Lock() same_directory_lock = Lock() + status_dict = {} task_dict = {} rss_dict = {} diff --git a/bot/helper/ext_utils/files_utils.py b/bot/helper/ext_utils/files_utils.py index abca3a4fdc6c..94f2346a287d 100644 --- a/bot/helper/ext_utils/files_utils.py +++ b/bot/helper/ext_utils/files_utils.py @@ -197,7 +197,11 @@ async def clean_unwanted(path, custom_list=None): dirpath, ignore_errors=True ) - for dirpath, _, files in await sync_to_async( + for ( + dirpath, + _, + files + ) in await sync_to_async( walk, path, topdown=False @@ -210,12 +214,19 @@ async def get_path_size(path): if await aiopath.isfile(path): return await aiopath.getsize(path) total_size = 0 - for root, _, files in await sync_to_async( + for ( + root, + _, + files + ) in await sync_to_async( walk, path ): for f in files: - abs_path = ospath.join(root, f) + abs_path = ospath.join( + root, + f + ) total_size += await aiopath.getsize(abs_path) return total_size diff --git a/bot/helper/ext_utils/token_manager.py b/bot/helper/ext_utils/token_manager.py index 5f4efe878cd5..f6ff18ab94a7 100644 --- a/bot/helper/ext_utils/token_manager.py +++ b/bot/helper/ext_utils/token_manager.py @@ -186,10 +186,16 @@ async def start(client, message): "Your Limites:\n" f"➜ {config_dict["USER_MAX_TASKS"]} parallal tasks.\n" ) - return await send_message( + await send_message( message, msg ) + await send_log_message( + message, + f"#TOKEN\n\nToken refreshed successfully.", + tag + ) + return elif ( config_dict["DM_MODE"] and message.chat.type != message.chat.type.SUPERGROUP diff --git a/bot/helper/telegram_helper/message_utils.py b/bot/helper/telegram_helper/message_utils.py index 2ef3f6d42d14..88d86615814d 100644 --- a/bot/helper/telegram_helper/message_utils.py +++ b/bot/helper/telegram_helper/message_utils.py @@ -60,7 +60,7 @@ async def send_message(message, text, buttons=None, block=True): async def edit_message(message, text, buttons=None, block=True): try: - await message.edit( + return await message.edit( text=text, disable_web_page_preview=True, reply_markup=buttons diff --git a/bot/modules/users_settings.py b/bot/modules/users_settings.py index 28e196c925ee..5c6d6d186550 100644 --- a/bot/modules/users_settings.py +++ b/bot/modules/users_settings.py @@ -576,7 +576,10 @@ async def set_option(message, option): elif option == "excluded_extensions": fx = config_dict["EXTENSION_FILTER"].split() fx += value.split() - value = ["aria2", "!qB"] + value = [ + "aria2", + "!qB" + ] for x in fx: x = x.lstrip(".") value.append(x.strip().lower())