from pyrogram import Client, enums, filters from pyrogram.types import Message import Backend from Backend.helper.custom_filter import CustomFilters from Backend.logger import LOGGER #----- Owner-only /set: set or clear the default IMDB/TMDB URL for uploads @Client.on_message(filters.command('set') & filters.private & CustomFilters.owner, group=10) async def manual(client: Client, message: Message): try: command = message.text.split(maxsplit=1) if len(command) == 2: Backend.USE_DEFAULT_ID = command[1].strip() await message.reply_text( f"✅ Default IMDB/TMDB URL Set!\n\n" f"Now the bot will use this URL for any files you send:\n" f"{Backend.USE_DEFAULT_ID}\n\n" f"Instructions:\n" f"1. Forward the related movie or TV show files to your channel.\n" f"2. Once all files are uploaded, clear the default URL by sending /set without any URL.", quote=True, parse_mode=enums.ParseMode.HTML ) else: Backend.USE_DEFAULT_ID = None await message.reply_text( "✅ Default IMDB/TMDB URL Removed!\n\n" "You can now manually upload files without linking to a default IMDB URL.", quote=True, parse_mode=enums.ParseMode.HTML ) except Exception as e: LOGGER.error(f"Error in /set handler: {e}") await message.reply_text(f"⚠️ An error occurred: {e}")