File size: 8,414 Bytes
749d864 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
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()
|