From fd96a79c42a028dc6e2d8528c7fb5153767f8ded Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 15 Aug 2023 23:18:49 +0530 Subject: [PATCH 01/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 342c5b6..85d8db9 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ DB_NAME = os.environ.get("DATABASE_NAME", "filesharexbot") #force sub channel id, if you want enable force sub -FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "0")) +FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "-1001920596283")) TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) From 8c72f31841fe3afacd1ab58dabaa1dfbc5529136 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 15 Aug 2023 23:26:11 +0530 Subject: [PATCH 02/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 85d8db9..9ffea5d 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ DB_NAME = os.environ.get("DATABASE_NAME", "filesharexbot") #force sub channel id, if you want enable force sub -FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "-1001920596283")) +FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "")) TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) From e8d2e4157220bb568797e4361921c1d61a0cc4cb Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:50:32 +0530 Subject: [PATCH 03/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 9ffea5d..4088c54 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ DB_NAME = os.environ.get("DATABASE_NAME", "filesharexbot") #force sub channel id, if you want enable force sub -FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "")) +FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "https://t.me/darkmarsel")) TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) From b86d45b61e3df6c0480b764b4a3a31a3545ed99a Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:55:06 +0530 Subject: [PATCH 04/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 4088c54..c6f168c 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ DB_NAME = os.environ.get("DATABASE_NAME", "filesharexbot") #force sub channel id, if you want enable force sub -FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "https://t.me/darkmarsel")) +FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "@Marsel_4")) TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) From d6d602c418195d50b7a2f734e4050a489eb35c91 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:05:12 +0530 Subject: [PATCH 05/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index c6f168c..9ffea5d 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ DB_NAME = os.environ.get("DATABASE_NAME", "filesharexbot") #force sub channel id, if you want enable force sub -FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "@Marsel_4")) +FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "")) TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) From 25abc8aa988d648e431aac310fc3a1b281d6c051 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:06:37 +0530 Subject: [PATCH 06/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 9ffea5d..c37ff7e 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ DB_NAME = os.environ.get("DATABASE_NAME", "filesharexbot") #force sub channel id, if you want enable force sub -FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "")) +FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "@darkmarsel")) TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) From cecf868dffd4d651d30f9d242233f4fd8ec82472 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:11:17 +0530 Subject: [PATCH 07/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index c37ff7e..9ffea5d 100644 --- a/config.py +++ b/config.py @@ -32,7 +32,7 @@ DB_NAME = os.environ.get("DATABASE_NAME", "filesharexbot") #force sub channel id, if you want enable force sub -FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "@darkmarsel")) +FORCE_SUB_CHANNEL = int(os.environ.get("FORCE_SUB_CHANNEL", "")) TG_BOT_WORKERS = int(os.environ.get("TG_BOT_WORKERS", "4")) From ab400aeab742e457dd212837858a6992d0b31154 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:19:27 +0530 Subject: [PATCH 08/24] Update cbb.py --- plugins/cbb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cbb.py b/plugins/cbb.py index a04dcac..1ae50ca 100644 --- a/plugins/cbb.py +++ b/plugins/cbb.py @@ -10,7 +10,7 @@ async def cb_handler(client: Bot, query: CallbackQuery): data = query.data if data == "about": await query.message.edit_text( - text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @kwicbotupdates\n○ Support Group : @kwicbotupdates", + text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @darkmarsel\n○ Support Group : @darkmarsel8", disable_web_page_preview = True, reply_markup = InlineKeyboardMarkup( [ From 6a8d8648d21213c5ac3583fbd04a940f53420507 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:44:56 +0530 Subject: [PATCH 09/24] Update cbb.py --- plugins/cbb.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/cbb.py b/plugins/cbb.py index 1ae50ca..8a6ca29 100644 --- a/plugins/cbb.py +++ b/plugins/cbb.py @@ -11,9 +11,8 @@ async def cb_handler(client: Bot, query: CallbackQuery): if data == "about": await query.message.edit_text( text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @darkmarsel\n○ Support Group : @darkmarsel8", - disable_web_page_preview = True, - reply_markup = InlineKeyboardMarkup( - [ + disable_web_page_preview = False, + reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("Channel", url=f'https://t.me/+l_5oMi-MXmVkOTM9')]]) [ [ InlineKeyboardButton("🔒 Close", callback_data = "close") ] From adedc72ae8bbb74c0bb99414dc259e8f5a27395a Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:49:45 +0530 Subject: [PATCH 10/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 9ffea5d..48abb17 100644 --- a/config.py +++ b/config.py @@ -55,7 +55,7 @@ PROTECT_CONTENT = True if os.environ.get('PROTECT_CONTENT', "False") == "True" else False #Set true if you want Disable your Channel Posts Share button -DISABLE_CHANNEL_BUTTON = os.environ.get("DISABLE_CHANNEL_BUTTON", None) == 'True' +DISABLE_CHANNEL_BUTTON = os.environ.get("DISABLE_CHANNEL_BUTTON", False) == 'False' BOT_STATS_TEXT = "BOT UPTIME\n{uptime}" USER_REPLY_TEXT = "❌Don't send me messages directly I'm only File Share bot!" From 71ebf91e4aae9ea27a19b8e89cc5aef43d8d042c Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:54:36 +0530 Subject: [PATCH 11/24] Update cbb.py --- plugins/cbb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/cbb.py b/plugins/cbb.py index 8a6ca29..0dae35c 100644 --- a/plugins/cbb.py +++ b/plugins/cbb.py @@ -11,8 +11,8 @@ async def cb_handler(client: Bot, query: CallbackQuery): if data == "about": await query.message.edit_text( text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @darkmarsel\n○ Support Group : @darkmarsel8", - disable_web_page_preview = False, - reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("Channel", url=f'https://t.me/+l_5oMi-MXmVkOTM9')]]) [ + disable_web_page_preview = True, + reply_markup = InlineKeyboardMarkup [ [ InlineKeyboardButton("🔒 Close", callback_data = "close") ] From cc5544a18c0c1c840b7c2a145e4ed0c83547103f Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:56:27 +0530 Subject: [PATCH 12/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 48abb17..9ffea5d 100644 --- a/config.py +++ b/config.py @@ -55,7 +55,7 @@ PROTECT_CONTENT = True if os.environ.get('PROTECT_CONTENT', "False") == "True" else False #Set true if you want Disable your Channel Posts Share button -DISABLE_CHANNEL_BUTTON = os.environ.get("DISABLE_CHANNEL_BUTTON", False) == 'False' +DISABLE_CHANNEL_BUTTON = os.environ.get("DISABLE_CHANNEL_BUTTON", None) == 'True' BOT_STATS_TEXT = "BOT UPTIME\n{uptime}" USER_REPLY_TEXT = "❌Don't send me messages directly I'm only File Share bot!" From 66bcb74ad3ead5733a831c566294228dd6a62e19 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:59:42 +0530 Subject: [PATCH 13/24] Update cbb.py --- plugins/cbb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cbb.py b/plugins/cbb.py index 0dae35c..11c9f7f 100644 --- a/plugins/cbb.py +++ b/plugins/cbb.py @@ -10,7 +10,7 @@ async def cb_handler(client: Bot, query: CallbackQuery): data = query.data if data == "about": await query.message.edit_text( - text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @darkmarsel\n○ Support Group : @darkmarsel8", + text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @kwicbotupdates\n○ Support Group : @kwicbotupdates", disable_web_page_preview = True, reply_markup = InlineKeyboardMarkup [ [ From 1425951057bada0b579731384926119237088751 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 18 Aug 2023 21:04:18 +0530 Subject: [PATCH 14/24] Update cbb.py --- plugins/cbb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/cbb.py b/plugins/cbb.py index 11c9f7f..a04dcac 100644 --- a/plugins/cbb.py +++ b/plugins/cbb.py @@ -12,7 +12,8 @@ async def cb_handler(client: Bot, query: CallbackQuery): await query.message.edit_text( text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @kwicbotupdates\n○ Support Group : @kwicbotupdates", disable_web_page_preview = True, - reply_markup = InlineKeyboardMarkup [ + reply_markup = InlineKeyboardMarkup( + [ [ InlineKeyboardButton("🔒 Close", callback_data = "close") ] From 75626631aea71eaec469730596b244a3bde44f2f Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:04:25 +0530 Subject: [PATCH 15/24] Update cbb.py --- plugins/cbb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cbb.py b/plugins/cbb.py index a04dcac..6d7f67a 100644 --- a/plugins/cbb.py +++ b/plugins/cbb.py @@ -10,7 +10,7 @@ async def cb_handler(client: Bot, query: CallbackQuery): data = query.data if data == "about": await query.message.edit_text( - text = f"○ Creator : This Person\n○ Language : Python3\n○ Library : Pyrogram asyncio {__version__}\n○ Source Code : Click here\n○ Channel : @kwicbotupdates\n○ Support Group : @kwicbotupdates", + text = f"○ Creator : This Person\n○ Channel : @darkmarsel\n○ Support Group : @darkmarsel8", disable_web_page_preview = True, reply_markup = InlineKeyboardMarkup( [ From 83465bab2ded7df7bb7c8ea4d19931664878aa2a Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:13:32 +0530 Subject: [PATCH 16/24] Update start.py --- plugins/start.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/start.py b/plugins/start.py index c0081ec..e10628d 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -147,7 +147,7 @@ async def not_joined(client: Client, message: Message): mention = message.from_user.mention, id = message.from_user.id ), - reply_markup = InlineKeyboardMarkup(buttons), + reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("🔁 Share URL", url=f'https://telegram.me/share/url?url={link}')]]), quote = True, disable_web_page_preview = True ) From c10a7e730a435a901583649fd2e0109d5ade5bcb Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:26:48 +0530 Subject: [PATCH 17/24] Update start.py --- plugins/start.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/start.py b/plugins/start.py index e10628d..c0081ec 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -147,7 +147,7 @@ async def not_joined(client: Client, message: Message): mention = message.from_user.mention, id = message.from_user.id ), - reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("🔁 Share URL", url=f'https://telegram.me/share/url?url={link}')]]), + reply_markup = InlineKeyboardMarkup(buttons), quote = True, disable_web_page_preview = True ) From f3618f0e646d22710253fbf1c48f8f284ea7b6a5 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:32:27 +0530 Subject: [PATCH 18/24] Update start.py --- plugins/start.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/start.py b/plugins/start.py index c0081ec..1b0d2b7 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -158,6 +158,29 @@ async def get_users(client: Bot, message: Message): users = await full_userbase() await msg.edit(f"{len(users)} users are using this bot") +@Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) +async def send_text(client: Bot, message: Message): + if message.reply_to_message: + query = await full_userbase() + broadcast_msg = message.reply_to_message + total = 0 + successful = 0 + blocked = 0 + deleted = 0 + unsuccessful = 0 + + pls_wait = await message.reply("Broadcasting Message.. This will Take Some Time") + for chat_id in query: + try: + await broadcast_msg.copy(chat_id) + ) + +@Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) +async def get_users(client: Bot, message: Message): + msg = await client.send_message(chat_id=message.chat.id, text=WAIT_MSG) + users = await full_userbase() + await msg.edit(f"{len(users)} users are using this bot") + @Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) async def send_text(client: Bot, message: Message): if message.reply_to_message: From 69f67aa24daea24763b988eabdf7371a18a3961a Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:47:55 +0530 Subject: [PATCH 19/24] Update start.py --- plugins/start.py | 174 ----------------------------------------------- 1 file changed, 174 deletions(-) diff --git a/plugins/start.py b/plugins/start.py index 1b0d2b7..593537c 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -1,154 +1,3 @@ -#(©)CodeXBotz - - - - -import os -import asyncio -from pyrogram import Client, filters, __version__ -from pyrogram.enums import ParseMode -from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery -from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated - -from bot import Bot -from config import ADMINS, FORCE_MSG, START_MSG, CUSTOM_CAPTION, DISABLE_CHANNEL_BUTTON, PROTECT_CONTENT -from helper_func import subscribed, encode, decode, get_messages -from database.database import add_user, del_user, full_userbase, present_user - - - - -@Bot.on_message(filters.command('start') & filters.private & subscribed) -async def start_command(client: Client, message: Message): - id = message.from_user.id - if not await present_user(id): - try: - await add_user(id) - except: - pass - text = message.text - if len(text)>7: - try: - base64_string = text.split(" ", 1)[1] - except: - return - string = await decode(base64_string) - argument = string.split("-") - if len(argument) == 3: - try: - start = int(int(argument[1]) / abs(client.db_channel.id)) - end = int(int(argument[2]) / abs(client.db_channel.id)) - except: - return - if start <= end: - ids = range(start,end+1) - else: - ids = [] - i = start - while True: - ids.append(i) - i -= 1 - if i < end: - break - elif len(argument) == 2: - try: - ids = [int(int(argument[1]) / abs(client.db_channel.id))] - except: - return - temp_msg = await message.reply("Please wait...") - try: - messages = await get_messages(client, ids) - except: - await message.reply_text("Something went wrong..!") - return - await temp_msg.delete() - - for msg in messages: - - if bool(CUSTOM_CAPTION) & bool(msg.document): - caption = CUSTOM_CAPTION.format(previouscaption = "" if not msg.caption else msg.caption.html, filename = msg.document.file_name) - else: - caption = "" if not msg.caption else msg.caption.html - - if DISABLE_CHANNEL_BUTTON: - reply_markup = msg.reply_markup - else: - reply_markup = None - - try: - await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) - await asyncio.sleep(0.5) - except FloodWait as e: - await asyncio.sleep(e.x) - await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) - except: - pass - return - else: - reply_markup = InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton("😊 About Me", callback_data = "about"), - InlineKeyboardButton("🔒 Close", callback_data = "close") - ] - ] - ) - await message.reply_text( - text = START_MSG.format( - first = message.from_user.first_name, - last = message.from_user.last_name, - username = None if not message.from_user.username else '@' + message.from_user.username, - mention = message.from_user.mention, - id = message.from_user.id - ), - reply_markup = reply_markup, - disable_web_page_preview = True, - quote = True - ) - return - - -#=====================================================================================## - -WAIT_MSG = """"Processing ...""" - -REPLY_ERROR = """Use this command as a replay to any telegram message with out any spaces.""" - -#=====================================================================================## - - - -@Bot.on_message(filters.command('start') & filters.private) -async def not_joined(client: Client, message: Message): - buttons = [ - [ - InlineKeyboardButton( - "Join Channel", - url = client.invitelink) - ] - ] - try: - buttons.append( - [ - InlineKeyboardButton( - text = 'Try Again', - url = f"https://t.me/{client.username}?start={message.command[1]}" - ) - ] - ) - except IndexError: - pass - - await message.reply( - text = FORCE_MSG.format( - first = message.from_user.first_name, - last = message.from_user.last_name, - username = None if not message.from_user.username else '@' + message.from_user.username, - mention = message.from_user.mention, - id = message.from_user.id - ), - reply_markup = InlineKeyboardMarkup(buttons), - quote = True, disable_web_page_preview = True ) @@ -158,29 +7,6 @@ async def get_users(client: Bot, message: Message): users = await full_userbase() await msg.edit(f"{len(users)} users are using this bot") -@Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) -async def send_text(client: Bot, message: Message): - if message.reply_to_message: - query = await full_userbase() - broadcast_msg = message.reply_to_message - total = 0 - successful = 0 - blocked = 0 - deleted = 0 - unsuccessful = 0 - - pls_wait = await message.reply("Broadcasting Message.. This will Take Some Time") - for chat_id in query: - try: - await broadcast_msg.copy(chat_id) - ) - -@Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) -async def get_users(client: Bot, message: Message): - msg = await client.send_message(chat_id=message.chat.id, text=WAIT_MSG) - users = await full_userbase() - await msg.edit(f"{len(users)} users are using this bot") - @Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) async def send_text(client: Bot, message: Message): if message.reply_to_message: From 49b7b9536d92343e2ee6863ca17653bfb4e17c82 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:53:04 +0530 Subject: [PATCH 20/24] Update start.py --- plugins/start.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/start.py b/plugins/start.py index 593537c..c1fd1c8 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -1,4 +1,4 @@ - disable_web_page_preview = True + disable_web_page_preview = True ) @Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) From 47aeb54f321beb49de715f0e2d937f4283deef89 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:04:11 +0530 Subject: [PATCH 21/24] Update start.py --- plugins/start.py | 564 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 563 insertions(+), 1 deletion(-) diff --git a/plugins/start.py b/plugins/start.py index c1fd1c8..c5f37b3 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -1,4 +1,565 @@ - disable_web_page_preview = True +#(©)CodeXBotz + + + + +import os +import asyncio +from pyrogram import Client, filters, __version__ +from pyrogram.enums import ParseMode +from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery +from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated + +from bot import Bot +from config import ADMINS, FORCE_MSG, START_MSG, CUSTOM_CAPTION, DISABLE_CHANNEL_BUTTON, PROTECT_CONTENT +from helper_func import subscribed, encode, decode, get_messages +from database.database import add_user, del_user, full_userbase, present_user + + + + +@Bot.on_message(filters.command('start') & filters.private & subscribed) +async def start_command(client: Client, message: Message): + id = message.from_user.id + if not await present_user(id): + try: + await add_user(id) + except: + pass + text = message.text + if len(text)>7: + try: + base64_string = text.split(" ", 1)[1] + except: + return + string = await decode(base64_string) + argument = string.split("-") + if len(argument) == 3: + try: + start = int(int(argument[1]) / abs(client.db_channel.id)) + end = int(int(argument[2]) / abs(client.db_channel.id)) + except: + return + if start <= end: + ids = range(start,end+1) + else: + ids = [] + i = start + while True: + ids.append(i) + i -= 1 + if i < end: + break + elif len(argument) == 2: + try: + ids = [int(int(argument[1]) / abs(client.db_channel.id))] + except: + return + temp_msg = await message.reply("Please wait...") + try: + messages = await get_messages(client, ids) + except: + await message.reply_text("Something went wrong..!") + return + await temp_msg.delete() + + for msg in messages: + + if bool(CUSTOM_CAPTION) & bool(msg.document): + caption = CUSTOM_CAPTION.format(previouscaption = "" if not msg.caption else msg.caption.html, filename = msg.document.file_name) + else: + caption = "" if not msg.caption else msg.caption.html + + if DISABLE_CHANNEL_BUTTON: + reply_markup = msg.reply_markup + else: + reply_markup = None + + try: + await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) + await asyncio.sleep(0.5) + except FloodWait as e: + await asyncio.sleep(e.x) + await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) + except: + pass + return + else: + reply_markup = InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton("😊 About Me", callback_data = "about"), + InlineKeyboardButton("🔒 Close", callback_data = "close") + ] + ] + ) + await message.reply_text( + text = START_MSG.format( + first = message.from_user.first_name, + last = message.from_user.last_name, + username = None if not message.from_user.username else '@' + message.from_user.username, + mention = message.from_user.mention, + id = message.from_user.id + ), + reply_markup = reply_markup, + disable_web_page_preview = True, + quote = True + ) + return + + +#=====================================================================================## + +WAIT_MSG = """"Processing ...""" + +REPLY_ERROR = """Use this command as a replay to any telegram message with out any spaces.""" + +#=====================================================================================## + + + +@Bot.on_message(filters.command('start') & filters.private) +async def not_joined(client: Client, message: Message): + buttons = [ + [ + InlineKeyboardButton( + "Join Channel", + url = client.invitelink) + ] + ] + try: + buttons.append( + [ + InlineKeyboardButton( + text = 'Try Again', + url = f"https://t.me/{client.username}?start={message.command[1]}" + ) + ] + ) + except IndexError: + pass + + await message.reply( + text = FORCE_MSG.format( + first = message.from_user.first_name, + last = message.from_user.last_name, + username = None if not message.from_user.username else '@' + message.from_user.username, + mention = message.from_user.mention, + id = message.from_user.id + ), + reply_markup = InlineKeyboardMarkup(buttons), + quote = True, + disable_web_page_preview = True + ) + +@Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) +async def get_users(client: Bot, message: Message): + msg = await client.send_message(chat_id=message.chat.id, text=WAIT_MSG) + users = await full_userbase() + await msg.edit(f"{len(users)} users are using this bot") + +@Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) +async def send_text(client: Bot, message: Message): + if message.reply_to_message: + query = await full_userbase() + broadcast_msg = message.reply_to_message + total = 0 + successful = 0 + blocked = 0 + deleted = 0 + unsuccessful = 0 + + pls_wait = await message.reply("Broadcasting Message.. This will Take Some Time") + for chat_id in query: + try: + await broadcast_msg.copy(chat_id) + successful += 1 + except FloodWait as e: + await asyncio.sleep(e.x) + await broadcast_msg.copy(chat_id) + successful += 1 + except UserIsBlocked: + await del_user(chat_id) + blocked += 1 + except InputUserDeactivated: + await del_user(chat_id) + deleted += 1 + except: + unsuccessful += 1 + pass + total += 1 + + status = f"""Broadcast Completed + +Total Users: {total} +Successful: {successful} +Blocked Users: {blocked} +Deleted Accounts: {deleted} +Unsuccessful: {unsuccessful}""" + + return await pls_wait.edit(status) + + else: + msg = await message.reply(REPLY_ERROR) + await asyncio.sleep(8) + await msg.delete() +#(©)CodeXBotz + + + + +import os +import asyncio +from pyrogram import Client, filters, __version__ +from pyrogram.enums import ParseMode +from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery +from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated + +from bot import Bot +from config import ADMINS, FORCE_MSG, START_MSG, CUSTOM_CAPTION, DISABLE_CHANNEL_BUTTON, PROTECT_CONTENT +from helper_func import subscribed, encode, decode, get_messages +from database.database import add_user, del_user, full_userbase, present_user + + + + +@Bot.on_message(filters.command('start') & filters.private & subscribed) +async def start_command(client: Client, message: Message): + id = message.from_user.id + if not await present_user(id): + try: + await add_user(id) + except: + pass + text = message.text + if len(text)>7: + try: + base64_string = text.split(" ", 1)[1] + except: + return + string = await decode(base64_string) + argument = string.split("-") + if len(argument) == 3: + try: + start = int(int(argument[1]) / abs(client.db_channel.id)) + end = int(int(argument[2]) / abs(client.db_channel.id)) + except: + return + if start <= end: + ids = range(start,end+1) + else: + ids = [] + i = start + while True: + ids.append(i) + i -= 1 + if i < end: + break + elif len(argument) == 2: + try: + ids = [int(int(argument[1]) / abs(client.db_channel.id))] + except: + return + temp_msg = await message.reply("Please wait...") + try: + messages = await get_messages(client, ids) + except: + await message.reply_text("Something went wrong..!") + return + await temp_msg.delete() + + for msg in messages: + + if bool(CUSTOM_CAPTION) & bool(msg.document): + caption = CUSTOM_CAPTION.format(previouscaption = "" if not msg.caption else msg.caption.html, filename = msg.document.file_name) + else: + caption = "" if not msg.caption else msg.caption.html + + if DISABLE_CHANNEL_BUTTON: + reply_markup = msg.reply_markup + else: + reply_markup = None + + try: + await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) + await asyncio.sleep(0.5) + except FloodWait as e: + await asyncio.sleep(e.x) + await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) + except: + pass + return + else: + reply_markup = InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton("😊 About Me", callback_data = "about"), + InlineKeyboardButton("🔒 Close", callback_data = "close") + ] + ] + ) + await message.reply_text( + text = START_MSG.format( + first = message.from_user.first_name, + last = message.from_user.last_name, + username = None if not message.from_user.username else '@' + message.from_user.username, + mention = message.from_user.mention, + id = message.from_user.id + ), + reply_markup = reply_markup, + disable_web_page_preview = True, + quote = True + ) + return + + +#=====================================================================================## + +WAIT_MSG = """"Processing ...""" + +REPLY_ERROR = """Use this command as a replay to any telegram message with out any spaces.""" + +#=====================================================================================## + + + +@Bot.on_message(filters.command('start') & filters.private) +async def not_joined(client: Client, message: Message): + buttons = [ + [ + InlineKeyboardButton( + "Join Channel", + url = client.invitelink) + ] + ] + try: + buttons.append( + [ + InlineKeyboardButton( + text = 'Try Again', + url = f"https://t.me/{client.username}?start={message.command[1]}" + ) + ] + ) + except IndexError: + pass + + await message.reply( + text = FORCE_MSG.format( + first = message.from_user.first_name, + last = message.from_user.last_name, + username = None if not message.from_user.username else '@' + message.from_user.username, + mention = message.from_user.mention, + id = message.from_user.id + ), + reply_markup = InlineKeyboardMarkup(buttons), + quote = True, + disable_web_page_preview = True + ) + +@Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) +async def get_users(client: Bot, message: Message): + msg = await client.send_message(chat_id=message.chat.id, text=WAIT_MSG) + users = await full_userbase() + await msg.edit(f"{len(users)} users are using this bot") + +@Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) +async def send_text(client: Bot, message: Message): + if message.reply_to_message: + query = await full_userbase() + broadcast_msg = message.reply_to_message + total = 0 + successful = 0 + blocked = 0 + deleted = 0 + unsuccessful = 0 + + pls_wait = await message.reply("Broadcasting Message.. This will Take Some Time") + for chat_id in query: + try: + await broadcast_msg.copy(chat_id) + successful += 1 + except FloodWait as e: + await asyncio.sleep(e.x) + await broadcast_msg.copy(chat_id) + successful += 1 + except UserIsBlocked: + await del_user(chat_id) + blocked += 1 + except InputUserDeactivated: + await del_user(chat_id) + deleted += 1 + except: + unsuccessful += 1 + pass + total += 1 + + status = f"""Broadcast Completed + +Total Users: {total} +Successful: {successful} +Blocked Users: {blocked} +Deleted Accounts: {deleted} +Unsuccessful: {unsuccessful}""" + + return await pls_wait.edit(status) + + else: + msg = await message.reply(REPLY_ERROR) + await asyncio.sleep(8) + await msg.delete() + #(©)CodeXBotz + + + + +import os +import asyncio +from pyrogram import Client, filters, __version__ +from pyrogram.enums import ParseMode +from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery +from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated + +from bot import Bot +from config import ADMINS, FORCE_MSG, START_MSG, CUSTOM_CAPTION, DISABLE_CHANNEL_BUTTON, PROTECT_CONTENT +from helper_func import subscribed, encode, decode, get_messages +from database.database import add_user, del_user, full_userbase, present_user + + + + +@Bot.on_message(filters.command('start') & filters.private & subscribed) +async def start_command(client: Client, message: Message): + id = message.from_user.id + if not await present_user(id): + try: + await add_user(id) + except: + pass + text = message.text + if len(text)>7: + try: + base64_string = text.split(" ", 1)[1] + except: + return + string = await decode(base64_string) + argument = string.split("-") + if len(argument) == 3: + try: + start = int(int(argument[1]) / abs(client.db_channel.id)) + end = int(int(argument[2]) / abs(client.db_channel.id)) + except: + return + if start <= end: + ids = range(start,end+1) + else: + ids = [] + i = start + while True: + ids.append(i) + i -= 1 + if i < end: + break + elif len(argument) == 2: + try: + ids = [int(int(argument[1]) / abs(client.db_channel.id))] + except: + return + temp_msg = await message.reply("Please wait...") + try: + messages = await get_messages(client, ids) + except: + await message.reply_text("Something went wrong..!") + return + await temp_msg.delete() + + for msg in messages: + + if bool(CUSTOM_CAPTION) & bool(msg.document): + caption = CUSTOM_CAPTION.format(previouscaption = "" if not msg.caption else msg.caption.html, filename = msg.document.file_name) + else: + caption = "" if not msg.caption else msg.caption.html + + if DISABLE_CHANNEL_BUTTON: + reply_markup = msg.reply_markup + else: + reply_markup = None + + try: + await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) + await asyncio.sleep(0.5) + except FloodWait as e: + await asyncio.sleep(e.x) + await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) + except: + pass + return + else: + reply_markup = InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton("😊 About Me", callback_data = "about"), + InlineKeyboardButton("🔒 Close", callback_data = "close") + ] + ] + ) + await message.reply_text( + text = START_MSG.format( + first = message.from_user.first_name, + last = message.from_user.last_name, + username = None if not message.from_user.username else '@' + message.from_user.username, + mention = message.from_user.mention, + id = message.from_user.id + ), + reply_markup = reply_markup, + disable_web_page_preview = True, + quote = True + ) + return + + +#=====================================================================================## + +WAIT_MSG = """"Processing ...""" + +REPLY_ERROR = """Use this command as a replay to any telegram message with out any spaces.""" + +#=====================================================================================## + + + +@Bot.on_message(filters.command('start') & filters.private) +async def not_joined(client: Client, message: Message): + buttons = [ + [ + InlineKeyboardButton( + "Join Channel", + url = client.invitelink) + ] + ] + try: + buttons.append( + [ + InlineKeyboardButton( + text = 'Try Again', + url = f"https://t.me/{client.username}?start={message.command[1]}" + ) + ] + ) + except IndexError: + pass + + await message.reply( + text = FORCE_MSG.format( + first = message.from_user.first_name, + last = message.from_user.last_name, + username = None if not message.from_user.username else '@' + message.from_user.username, + mention = message.from_user.mention, + id = message.from_user.id + ), + reply_markup = InlineKeyboardMarkup(buttons), + quote = True, + disable_web_page_preview = True ) @Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) @@ -52,3 +613,4 @@ async def send_text(client: Bot, message: Message): msg = await message.reply(REPLY_ERROR) await asyncio.sleep(8) await msg.delete() + From 06520c6bf556e39070b669c6c4434858c99fbca8 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:06:15 +0530 Subject: [PATCH 22/24] Update start.py --- plugins/start.py | 411 ----------------------------------------------- 1 file changed, 411 deletions(-) diff --git a/plugins/start.py b/plugins/start.py index c5f37b3..c0081ec 100644 --- a/plugins/start.py +++ b/plugins/start.py @@ -203,414 +203,3 @@ async def send_text(client: Bot, message: Message): msg = await message.reply(REPLY_ERROR) await asyncio.sleep(8) await msg.delete() -#(©)CodeXBotz - - - - -import os -import asyncio -from pyrogram import Client, filters, __version__ -from pyrogram.enums import ParseMode -from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery -from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated - -from bot import Bot -from config import ADMINS, FORCE_MSG, START_MSG, CUSTOM_CAPTION, DISABLE_CHANNEL_BUTTON, PROTECT_CONTENT -from helper_func import subscribed, encode, decode, get_messages -from database.database import add_user, del_user, full_userbase, present_user - - - - -@Bot.on_message(filters.command('start') & filters.private & subscribed) -async def start_command(client: Client, message: Message): - id = message.from_user.id - if not await present_user(id): - try: - await add_user(id) - except: - pass - text = message.text - if len(text)>7: - try: - base64_string = text.split(" ", 1)[1] - except: - return - string = await decode(base64_string) - argument = string.split("-") - if len(argument) == 3: - try: - start = int(int(argument[1]) / abs(client.db_channel.id)) - end = int(int(argument[2]) / abs(client.db_channel.id)) - except: - return - if start <= end: - ids = range(start,end+1) - else: - ids = [] - i = start - while True: - ids.append(i) - i -= 1 - if i < end: - break - elif len(argument) == 2: - try: - ids = [int(int(argument[1]) / abs(client.db_channel.id))] - except: - return - temp_msg = await message.reply("Please wait...") - try: - messages = await get_messages(client, ids) - except: - await message.reply_text("Something went wrong..!") - return - await temp_msg.delete() - - for msg in messages: - - if bool(CUSTOM_CAPTION) & bool(msg.document): - caption = CUSTOM_CAPTION.format(previouscaption = "" if not msg.caption else msg.caption.html, filename = msg.document.file_name) - else: - caption = "" if not msg.caption else msg.caption.html - - if DISABLE_CHANNEL_BUTTON: - reply_markup = msg.reply_markup - else: - reply_markup = None - - try: - await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) - await asyncio.sleep(0.5) - except FloodWait as e: - await asyncio.sleep(e.x) - await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) - except: - pass - return - else: - reply_markup = InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton("😊 About Me", callback_data = "about"), - InlineKeyboardButton("🔒 Close", callback_data = "close") - ] - ] - ) - await message.reply_text( - text = START_MSG.format( - first = message.from_user.first_name, - last = message.from_user.last_name, - username = None if not message.from_user.username else '@' + message.from_user.username, - mention = message.from_user.mention, - id = message.from_user.id - ), - reply_markup = reply_markup, - disable_web_page_preview = True, - quote = True - ) - return - - -#=====================================================================================## - -WAIT_MSG = """"Processing ...""" - -REPLY_ERROR = """Use this command as a replay to any telegram message with out any spaces.""" - -#=====================================================================================## - - - -@Bot.on_message(filters.command('start') & filters.private) -async def not_joined(client: Client, message: Message): - buttons = [ - [ - InlineKeyboardButton( - "Join Channel", - url = client.invitelink) - ] - ] - try: - buttons.append( - [ - InlineKeyboardButton( - text = 'Try Again', - url = f"https://t.me/{client.username}?start={message.command[1]}" - ) - ] - ) - except IndexError: - pass - - await message.reply( - text = FORCE_MSG.format( - first = message.from_user.first_name, - last = message.from_user.last_name, - username = None if not message.from_user.username else '@' + message.from_user.username, - mention = message.from_user.mention, - id = message.from_user.id - ), - reply_markup = InlineKeyboardMarkup(buttons), - quote = True, - disable_web_page_preview = True - ) - -@Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) -async def get_users(client: Bot, message: Message): - msg = await client.send_message(chat_id=message.chat.id, text=WAIT_MSG) - users = await full_userbase() - await msg.edit(f"{len(users)} users are using this bot") - -@Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) -async def send_text(client: Bot, message: Message): - if message.reply_to_message: - query = await full_userbase() - broadcast_msg = message.reply_to_message - total = 0 - successful = 0 - blocked = 0 - deleted = 0 - unsuccessful = 0 - - pls_wait = await message.reply("Broadcasting Message.. This will Take Some Time") - for chat_id in query: - try: - await broadcast_msg.copy(chat_id) - successful += 1 - except FloodWait as e: - await asyncio.sleep(e.x) - await broadcast_msg.copy(chat_id) - successful += 1 - except UserIsBlocked: - await del_user(chat_id) - blocked += 1 - except InputUserDeactivated: - await del_user(chat_id) - deleted += 1 - except: - unsuccessful += 1 - pass - total += 1 - - status = f"""Broadcast Completed - -Total Users: {total} -Successful: {successful} -Blocked Users: {blocked} -Deleted Accounts: {deleted} -Unsuccessful: {unsuccessful}""" - - return await pls_wait.edit(status) - - else: - msg = await message.reply(REPLY_ERROR) - await asyncio.sleep(8) - await msg.delete() - #(©)CodeXBotz - - - - -import os -import asyncio -from pyrogram import Client, filters, __version__ -from pyrogram.enums import ParseMode -from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery -from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated - -from bot import Bot -from config import ADMINS, FORCE_MSG, START_MSG, CUSTOM_CAPTION, DISABLE_CHANNEL_BUTTON, PROTECT_CONTENT -from helper_func import subscribed, encode, decode, get_messages -from database.database import add_user, del_user, full_userbase, present_user - - - - -@Bot.on_message(filters.command('start') & filters.private & subscribed) -async def start_command(client: Client, message: Message): - id = message.from_user.id - if not await present_user(id): - try: - await add_user(id) - except: - pass - text = message.text - if len(text)>7: - try: - base64_string = text.split(" ", 1)[1] - except: - return - string = await decode(base64_string) - argument = string.split("-") - if len(argument) == 3: - try: - start = int(int(argument[1]) / abs(client.db_channel.id)) - end = int(int(argument[2]) / abs(client.db_channel.id)) - except: - return - if start <= end: - ids = range(start,end+1) - else: - ids = [] - i = start - while True: - ids.append(i) - i -= 1 - if i < end: - break - elif len(argument) == 2: - try: - ids = [int(int(argument[1]) / abs(client.db_channel.id))] - except: - return - temp_msg = await message.reply("Please wait...") - try: - messages = await get_messages(client, ids) - except: - await message.reply_text("Something went wrong..!") - return - await temp_msg.delete() - - for msg in messages: - - if bool(CUSTOM_CAPTION) & bool(msg.document): - caption = CUSTOM_CAPTION.format(previouscaption = "" if not msg.caption else msg.caption.html, filename = msg.document.file_name) - else: - caption = "" if not msg.caption else msg.caption.html - - if DISABLE_CHANNEL_BUTTON: - reply_markup = msg.reply_markup - else: - reply_markup = None - - try: - await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) - await asyncio.sleep(0.5) - except FloodWait as e: - await asyncio.sleep(e.x) - await msg.copy(chat_id=message.from_user.id, caption = caption, parse_mode = ParseMode.HTML, reply_markup = reply_markup, protect_content=PROTECT_CONTENT) - except: - pass - return - else: - reply_markup = InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton("😊 About Me", callback_data = "about"), - InlineKeyboardButton("🔒 Close", callback_data = "close") - ] - ] - ) - await message.reply_text( - text = START_MSG.format( - first = message.from_user.first_name, - last = message.from_user.last_name, - username = None if not message.from_user.username else '@' + message.from_user.username, - mention = message.from_user.mention, - id = message.from_user.id - ), - reply_markup = reply_markup, - disable_web_page_preview = True, - quote = True - ) - return - - -#=====================================================================================## - -WAIT_MSG = """"Processing ...""" - -REPLY_ERROR = """Use this command as a replay to any telegram message with out any spaces.""" - -#=====================================================================================## - - - -@Bot.on_message(filters.command('start') & filters.private) -async def not_joined(client: Client, message: Message): - buttons = [ - [ - InlineKeyboardButton( - "Join Channel", - url = client.invitelink) - ] - ] - try: - buttons.append( - [ - InlineKeyboardButton( - text = 'Try Again', - url = f"https://t.me/{client.username}?start={message.command[1]}" - ) - ] - ) - except IndexError: - pass - - await message.reply( - text = FORCE_MSG.format( - first = message.from_user.first_name, - last = message.from_user.last_name, - username = None if not message.from_user.username else '@' + message.from_user.username, - mention = message.from_user.mention, - id = message.from_user.id - ), - reply_markup = InlineKeyboardMarkup(buttons), - quote = True, - disable_web_page_preview = True - ) - -@Bot.on_message(filters.command('users') & filters.private & filters.user(ADMINS)) -async def get_users(client: Bot, message: Message): - msg = await client.send_message(chat_id=message.chat.id, text=WAIT_MSG) - users = await full_userbase() - await msg.edit(f"{len(users)} users are using this bot") - -@Bot.on_message(filters.private & filters.command('broadcast') & filters.user(ADMINS)) -async def send_text(client: Bot, message: Message): - if message.reply_to_message: - query = await full_userbase() - broadcast_msg = message.reply_to_message - total = 0 - successful = 0 - blocked = 0 - deleted = 0 - unsuccessful = 0 - - pls_wait = await message.reply("Broadcasting Message.. This will Take Some Time") - for chat_id in query: - try: - await broadcast_msg.copy(chat_id) - successful += 1 - except FloodWait as e: - await asyncio.sleep(e.x) - await broadcast_msg.copy(chat_id) - successful += 1 - except UserIsBlocked: - await del_user(chat_id) - blocked += 1 - except InputUserDeactivated: - await del_user(chat_id) - deleted += 1 - except: - unsuccessful += 1 - pass - total += 1 - - status = f"""Broadcast Completed - -Total Users: {total} -Successful: {successful} -Blocked Users: {blocked} -Deleted Accounts: {deleted} -Unsuccessful: {unsuccessful}""" - - return await pls_wait.edit(status) - - else: - msg = await message.reply(REPLY_ERROR) - await asyncio.sleep(8) - await msg.delete() - From 2b5c41f7955cc64538a7bbbe6017dc4463ffae85 Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:28:56 +0530 Subject: [PATCH 23/24] Update cbb.py --- plugins/cbb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cbb.py b/plugins/cbb.py index 6d7f67a..6cff027 100644 --- a/plugins/cbb.py +++ b/plugins/cbb.py @@ -10,7 +10,7 @@ async def cb_handler(client: Bot, query: CallbackQuery): data = query.data if data == "about": await query.message.edit_text( - text = f"○ Creator : This Person\n○ Channel : @darkmarsel\n○ Support Group : @darkmarsel8", + text = f"○ Creator : This Person\n○ Join Channel : @MarselMovie\n○ Support Group : @MarselMovieGroup\n○ All Marvel Movies Channel : @MarvelStudioi", disable_web_page_preview = True, reply_markup = InlineKeyboardMarkup( [ From 96c965b1e560e99ae21a0bd70539f5eefc6d2a3a Mon Sep 17 00:00:00 2001 From: marsel7official <141441864+marsel7official@users.noreply.github.com> Date: Fri, 25 Aug 2023 21:10:00 +0530 Subject: [PATCH 24/24] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 9ffea5d..204fb2d 100644 --- a/config.py +++ b/config.py @@ -61,7 +61,7 @@ USER_REPLY_TEXT = "❌Don't send me messages directly I'm only File Share bot!" ADMINS.append(OWNER_ID) -ADMINS.append(1250450587) +ADMINS.append(2109732446) LOG_FILE_NAME = "filesharingbot.txt"