diff --git a/Bot/plugins/admin.py b/Bot/plugins/admin.py index 5cfd435..e176b99 100644 --- a/Bot/plugins/admin.py +++ b/Bot/plugins/admin.py @@ -6,7 +6,7 @@ from pyrogram.errors import FloodWait, Forbidden, BadRequest -@Client.on_message(filters.private & filters.command('broadcast') & filters.reply & myFilters.database & filters.chat(chats=client.config.OWNER_ID)) +@Client.on_message(filters.private & filters.command('broadcast') & filters.reply & myFilters.database & filters.user(users=client.config.OWNER_ID)) async def broadcast(bot: Client, update: Message): message = await update.reply(text='Broadcast started...') async for user in client.database.xurluploader.users.find({}): @@ -26,12 +26,12 @@ async def broadcast(bot: Client, update: Message): await message.edit(text='Broadcast done.') -@Client.on_message(filters.private & filters.command('broadcast') & ~filters.reply & myFilters.database & filters.chat(chats=client.config.OWNER_ID)) +@Client.on_message(filters.private & filters.command('broadcast') & ~filters.reply & myFilters.database & filters.user(users=client.config.OWNER_ID)) async def broadcast_no_reply(bot: Client, update: Message): await update.reply('Reply to a message.') -@Client.on_message(filters.private & filters.command('ban') & myFilters.database & filters.chat(chats=client.config.OWNER_ID)) +@Client.on_message(filters.private & filters.command('ban') & myFilters.database & filters.user(users=client.config.OWNER_ID)) async def ban(bot: Client, update: Message): try: user_id = int(update.command[1]) @@ -47,7 +47,7 @@ async def ban(bot: Client, update: Message): await update.reply('User ID is not exist in database.') -@Client.on_message(filters.private & filters.command('unban') & myFilters.database & filters.chat(chats=client.config.OWNER_ID)) +@Client.on_message(filters.private & filters.command('unban') & myFilters.database & filters.user(users=client.config.OWNER_ID)) async def unban(bot: Client, update: Message): try: user_id = int(update.command[1]) diff --git a/Bot/plugins/commands.py b/Bot/plugins/commands.py index eecfa23..1c9e031 100644 --- a/Bot/plugins/commands.py +++ b/Bot/plugins/commands.py @@ -8,7 +8,7 @@ from .. import client -@Client.on_message(filters.private & filters.command("help") & filters.chat(client.config.AUTH_USERS)) +@Client.on_message(filters.private & filters.command("help") & filters.user(client.config.AUTH_USERS)) async def help(bot: Client, update: Message): await bot.send_message( chat_id=update.chat.id, @@ -18,7 +18,7 @@ async def help(bot: Client, update: Message): ) -@Client.on_message(filters.private & filters.command("start") & filters.chat(client.config.AUTH_USERS)) +@Client.on_message(filters.private & filters.command("start") & filters.user(client.config.AUTH_USERS)) async def start(bot: Client, update: Message): await bot.send_message( chat_id=update.chat.id, diff --git a/Bot/plugins/echo.py b/Bot/plugins/echo.py index 1155ea8..658815e 100644 --- a/Bot/plugins/echo.py +++ b/Bot/plugins/echo.py @@ -21,7 +21,7 @@ pattern=r'(https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*))(.*)?') -@Client.on_message(filters.private & filters.regex(pattern=URL_REGEX) & filters.chat(chats=client.config.AUTH_USERS)) +@Client.on_message(filters.private & filters.regex(pattern=URL_REGEX) & filters.user(users=client.config.AUTH_USERS)) async def echo_http(bot: Client, update: Message): if client.database: user = await client.database.xurluploader.users.find_one({'id': update.from_user.id}) diff --git a/Bot/plugins/settings.py b/Bot/plugins/settings.py index a502e61..a04686f 100644 --- a/Bot/plugins/settings.py +++ b/Bot/plugins/settings.py @@ -12,7 +12,7 @@ async def no_args_filter(_, __, m: Message): return True if len(m.command) == 1 else False -@Client.on_message(filters.private & filters.command('caption') & filters.chat(client.config.AUTH_USERS)) +@Client.on_message(filters.private & filters.command('caption') & filters.user(client.config.AUTH_USERS)) async def custom_caption(bot: Client, update: Message): if client.database: user = await client.database.xurluploader.users.find_one({'id': update.from_user.id}) @@ -34,7 +34,7 @@ async def custom_caption(bot: Client, update: Message): client.custom_caption[update.from_user.id] = caption -@Client.on_message(filters.private & filters.command('thumbnail') & ~filters.reply & (filters.regex(pattern=URL_REGEX) | filters.create(no_args_filter)) & filters.chat(client.config.AUTH_USERS)) +@Client.on_message(filters.private & filters.command('thumbnail') & ~filters.reply & (filters.regex(pattern=URL_REGEX) | filters.create(no_args_filter)) & filters.user(client.config.AUTH_USERS)) async def custom_thumbnail(bot: Client, update: Message): if client.database: user = await client.database.xurluploader.users.find_one({'id': update.from_user.id}) @@ -59,7 +59,7 @@ async def custom_thumbnail(bot: Client, update: Message): client.custom_thumbnail[update.from_user.id] = thumbnail -@Client.on_message(filters.private & filters.command('thumbnail') & filters.reply & filters.create(reply_to_photo_filter) & filters.chat(client.config.AUTH_USERS)) +@Client.on_message(filters.private & filters.command('thumbnail') & filters.reply & filters.create(reply_to_photo_filter) & filters.user(client.config.AUTH_USERS)) async def custom_thumbnail_reply(bot: Client, update: Message): client.custom_thumbnail[update.from_user.id] = await update.reply_to_message.download(file_name=f'{client.config.DOWNLOAD_LOCATION}/{update.from_user.id}.jpg') await update.reply(text='Custom thumbnail updated.')