import telebot from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton, BotCommand import re # --- الإعدادات --- TOKEN = '8210606198:AAGdFQTlpCAarpxsz5SfZtWsF7zFfafd5Pg' DEVELOPER_ID = 7968256413 # ضع الـ ID الخاص بك هنا bot = telebot.TeleBot(TOKEN) # --- 1. دالة القائمة (هنا نضع الـ scope لضمان الظهور) --- def set_bot_commands(): commands = [ BotCommand("start", "القائمة الرئيسية والأزرار"), BotCommand("tool1", "مكتبة 1"), BotCommand("tool2", " مكتبة 2"), BotCommand("tool3", " مكتبة 3"), BotCommand("dev", "تواصل مع المطور") ] bot.set_my_commands(commands, scope=BotCommandScopeDefault()) user_status = {} # --- بنك الأكواد البرمجية --- TOOLS_CODES = { "c1": """``` #PyTool Kit import os print("لاتنسه متابعتي علئ قناتي التليجرام @ll14bo") print("∞"*60) os.system('pip install requests') os.system('pip install pyfiglet') os.system('pip install sys') os.system('pip install py_compile') os.system('pip install youtube_dl') os.system('pip install uuid') os.system('pip install time') os.system('pip install os') os.system('pip install random') os.system('pip install datetime') os.system('pip install string') os.system('pip install secrets') os.system('pip install webbrowser') os.system('pip install hashlib') os.system('pip install colorama') os.system('pip install n') os.system('pip install mm') os.system('pip install new') os.system('pip install sleep') os.system('pip install BeautifulSoup') os.system('pip install new') os.system('pip install pafy') os.system('pip install bs4') os.system('pip install sys') os.system('pip install json') os.system('pip install random') os.system('pip install uuid') os.system('pip install secrets') os.system('pip install datetime') os.system('pip install *') os.system('pip install argparse') os.system('pip install InstagramAPI') os.system('pip install sleep') os.system('pip install string') os.system('pip install uuid4') os.system('pip install generate_user_agent') os.system('pip install threading') os.system('pip install json') os.system('pip install datetime') os.system('pip install token_hex') os.system('pip install secrets') os.system('pip install token_hex') os.system('pip install Fore') os.system('pip install secrets') os.system('pip install uuid') os.system('pip install re') os.system('pip install b') os.system('cls' if os.name == 'nt' else 'clear') print("≠"*60) print("تم اكتمال جميع المكاتب الان يمكن استخدام اي اداة بدون مشكله ") print("Welcome to PyTool Kit") ```""", "c2": """``` #PYTool Kit import os print("لاتنسه متابعتي علئ قناتي التليجرام @bthon @ll14bo") print("∞"*5) os.system('pip install os') os.system('pip install requests') os.system('pip install instaloader') os.system('pip webbrowser') os.system('time') ```""", "c3": """``` #PyTool Kit import os , sys from time import sleep installed = 0 os.system('pip3 install --upgrade pip') try: import requests except: os.system('pip install requests') installed +=1 try: import user_agent except: os.system('pip install user_agent') installed +=1 try: import colorama except: os.system('pip install colorama') installed +=1 try: import myigbot except: os.system('pip install myigbot') installed +=1 try: from uuid import uuid4 except: os.system('pip install uuid') installed +=1 try: from bs4 import BeautifulSoup except: os.system('pip install bs4') installed +=1 try: import wget except: os.system('pip install wget') installed +=1 try: import telebot except: os.system('pip uninstall telebot') os.system('pip uninstall PyTelegramBotAPI') os.system('pip install PyTelegramBotAPI==3.6.7') installed +=1 try: import pyfiglet except: os.system('pip install pyfiglet') installed +=1 try: import webbrowser except: os.system('pip install webbrowser') installed +=1 os.system('cls' if os.name == 'nt' else 'clear') print('[-] Done Install '+str(installed)+ 'library') webbrowser.open('https://t.me/ll14bo') sleep(5) quit() ```""" } # --- 2. معالجة الأوامر --- @bot.message_handler(commands=['start']) def start(message): user_status[message.chat.id] = None markup = InlineKeyboardMarkup() btn1 = InlineKeyboardButton("📂 مكتبة 1", callback_data="c1") btn2 = InlineKeyboardButton("📂 مكتبة 2", callback_data="c2") btn3 = InlineKeyboardButton("📂 مكتبة 3", callback_data="c3") dev_btn = InlineKeyboardButton("👨‍💻 المطور Developer", callback_data="dev") markup.row(btn1, btn2, btn3) markup.row(dev_btn) bot.send_message(message.chat.id, "أهلاً بك! اختر من القائمة أو الأزرار:", reply_markup=markup) @bot.message_handler(commands=['start']) def start(message): user_status[message.chat.id] = None markup = InlineKeyboardMarkup(row_width=2) # إضافة أزرار الأكواد btn1 = InlineKeyboardButton("📂lib مكتبة 1", callback_data="c1") btn2 = InlineKeyboardButton("📂lib مكتبة 2", callback_data="c2") btn3 = InlineKeyboardButton("📂lib مكتبة 3", callback_data="c3") dev_btn = InlineKeyboardButton("👨‍💻 المطور Developer", callback_data="dev") # إضافة أول 3 أزرار في صف واحد markup.row(btn1, btn2, btn3) # إضافة زر المطور في صف منفرد markup.row(dev_btn) bot.send_message(message.chat.id, "Welcome! Choose a tool code or contact me:", reply_markup=markup) @bot.callback_query_handler(func=lambda call: True) def handle_query(call): if call.data == "dev": user_status[call.message.chat.id] = 'waiting' bot.send_message(call.message.chat.id, " Send your problem or anything else now (text, image, file) and the developer will get in touch...\n \n 📤 أرسل مشكلتك او أي شيء الآن (نص، صورة، ملف) وسيصل للمطور. \nالقناة @ll14bo") elif call.data in TOOLS_CODES: user_status[call.message.chat.id] = None bot.send_message(call.message.chat.id, TOOLS_CODES[call.data], parse_mode='Markdown') bot.answer_callback_query(call.id) # 1. نظام تحويل رسائل المستخدم للمطور (يدعم كل الأنواع) @bot.message_handler(func=lambda m: user_status.get(m.chat.id) == 'waiting', content_types=['text', 'photo', 'document', 'video', 'voice']) def forward_to_dev(message): # إرسال رسالة تنبيه للمطور تحتوي على ID المستخدم bot.send_message(DEVELOPER_ID, f"📩 رسالة من: `{message.chat.id}`\n(قم بالرد على هذه الرسالة للمراسلة)", parse_mode='Markdown') # تحويل الرسالة الفعلية bot.forward_message(DEVELOPER_ID, message.chat.id, message.message_id) bot.reply_to(message, "The message was successfully forwarded.\n ✅ تم إرسال رسالتك بنجاح.") user_status[message.chat.id] = None # 2. نظام رد المطور (اعمل Reply على رسالة الـ ID) @bot.message_handler(func=lambda message: message.from_user.id == DEVELOPER_ID and message.reply_to_message is not None) def reply_to_user(message): try: # استخراج الـ ID من نص الرسالة التي تم الرد عليها reply_text = message.reply_to_message.text if message.reply_to_message.text else message.reply_to_message.caption match = re.search(r'\d{7,}', reply_text) if match: target_id = match.group() bot.send_message(target_id, f"👨‍💻 **رد من المطور:**\n\n{message.text}", parse_mode='Markdown') bot.reply_to(message, "✅ تم إرسال ردك للمستخدم.") else: bot.reply_to(message, "❌ لم أجد ID المستخدم في الرسالة. تأكد من الرد على الرسالة التي تحتوي على الرقم.") except Exception as e: bot.reply_to(message, f"❌ حدث خطأ: {e}") bot.delete_my_commands() set_bot_commands() print("البوت يعمل الان.......") bot.infinity_polling()