Spaces:
Running on Zero
Running on Zero
Update bot.py
Browse files
bot.py
CHANGED
|
@@ -4,7 +4,7 @@ from datetime import datetime, timezone
|
|
| 4 |
from pyrogram import Client, filters
|
| 5 |
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
|
| 6 |
from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated
|
| 7 |
-
from config import API_ID, API_HASH, BOT_TOKEN, ADMINS, OWNER_HANDLE, SUPPORT_GROUP
|
| 8 |
from db import db
|
| 9 |
|
| 10 |
try:
|
|
@@ -27,7 +27,7 @@ class Bot(Client):
|
|
| 27 |
bot_token=BOT_TOKEN,
|
| 28 |
plugins=dict(root="TechVJ"),
|
| 29 |
workers=150,
|
| 30 |
-
max_concurrent_transmissions=
|
| 31 |
sleep_threshold=5
|
| 32 |
)
|
| 33 |
|
|
@@ -63,14 +63,12 @@ def get_start_panel(name: str, is_adm: bool = False, lang: str = "hi"):
|
|
| 63 |
f"👋 **Welcome to Save Restricted Content Bot!**{admin_tag}\n"
|
| 64 |
"━━━━━━━━━━━━━━━━━━━━\n\n"
|
| 65 |
"Clone or forward files from any **private or public** Telegram channel/group — "
|
| 66 |
-
"even if forwarding is restricted.\n\n"
|
| 67 |
-
"⚡ **Features:**\n"
|
| 68 |
"✅ Dedicated 1 GB RAM per user\n"
|
| 69 |
-
"✅
|
| 70 |
-
"✅
|
| 71 |
-
"✅ 2GB+ files ·
|
| 72 |
-
"✅
|
| 73 |
-
"✅ Multi-stream Fast Download/Upload Engine\n\n"
|
| 74 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 75 |
"Select an option from the menu below:"
|
| 76 |
)
|
|
@@ -81,10 +79,10 @@ def get_start_panel(name: str, is_adm: bool = False, lang: str = "hi"):
|
|
| 81 |
],
|
| 82 |
[
|
| 83 |
InlineKeyboardButton("📖 User Guide & Video", callback_data="nav_howtouse"),
|
| 84 |
-
InlineKeyboardButton("📢 Channel
|
| 85 |
],
|
| 86 |
[
|
| 87 |
-
InlineKeyboardButton("⚡ Speed
|
| 88 |
InlineKeyboardButton("📊 My Status", callback_data="nav_myplan")
|
| 89 |
],
|
| 90 |
[
|
|
@@ -100,15 +98,13 @@ def get_start_panel(name: str, is_adm: bool = False, lang: str = "hi"):
|
|
| 100 |
text = (
|
| 101 |
f"👋 **Welcome to Save Restricted Content Bot!**{admin_tag}\n"
|
| 102 |
"━━━━━━━━━━━━━━━━━━━━\n\n"
|
| 103 |
-
"
|
| 104 |
-
"
|
| 105 |
-
"⚡ **मुख्य विशेषताएं:**\n"
|
| 106 |
"✅ Dedicated 1 GB RAM per user\n"
|
| 107 |
-
"✅
|
| 108 |
-
"✅
|
| 109 |
-
"✅ 2GB+
|
| 110 |
-
"✅
|
| 111 |
-
"✅ मल्टी-स्ट्रीम सुपरफास्ट इंजन\n\n"
|
| 112 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 113 |
"नीचे दिए गए मेन्यू में से विकल्प चुनें:"
|
| 114 |
)
|
|
@@ -119,10 +115,10 @@ def get_start_panel(name: str, is_adm: bool = False, lang: str = "hi"):
|
|
| 119 |
],
|
| 120 |
[
|
| 121 |
InlineKeyboardButton("📖 बॉट कैसे चलाएं (गाइड & वीडियो)", callback_data="nav_howtouse"),
|
| 122 |
-
InlineKeyboardButton("📢 चैनल
|
| 123 |
],
|
| 124 |
[
|
| 125 |
-
InlineKeyboardButton("⚡ स्पीड
|
| 126 |
InlineKeyboardButton("📊 मेरा स्टेटस", callback_data="nav_myplan")
|
| 127 |
],
|
| 128 |
[
|
|
@@ -153,9 +149,9 @@ def get_plans_text(lang: str = "hi"):
|
|
| 153 |
f"🔹 **30 Days (Monthly Unlimited):** ₹{plans.get('30days', '199')}\n\n"
|
| 154 |
"🔥 **Features Included in All Plans:**\n"
|
| 155 |
"• Unlimited files, videos & PDFs transfer\n"
|
| 156 |
-
"•
|
| 157 |
-
"•
|
| 158 |
-
"•
|
| 159 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 160 |
"Click **'💳 How to Pay'** below to activate."
|
| 161 |
)
|
|
@@ -168,9 +164,9 @@ def get_plans_text(lang: str = "hi"):
|
|
| 168 |
f"🔹 **30 दिन (मंथली अनलिमिटेड):** ₹{plans.get('30days', '199')}\n\n"
|
| 169 |
"🔥 **सभी प्लान्स में शामिल:**\n"
|
| 170 |
"• अनलिमिटेड फाइल्स, वीडियो व PDFs ट्रांसफर\n"
|
| 171 |
-
"•
|
| 172 |
-
"•
|
| 173 |
-
"•
|
| 174 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 175 |
"पेमेंट करने के लिए नीचे **'💳 पेमेंट कैसे करें'** बटन दबाएँ।"
|
| 176 |
)
|
|
@@ -196,7 +192,7 @@ def get_payment_caption(lang: str = "hi"):
|
|
| 196 |
f"👉 [Click here to buy PhonePe Gift Card]({PHONEPE_LINK})\n\n"
|
| 197 |
"2️⃣ In PhonePe, select **'Buy New Gift Card'**.\n"
|
| 198 |
"3️⃣ Enter the exact amount for your chosen plan & complete the payment.\n"
|
| 199 |
-
"4️⃣ After payment, you will receive a **16-digit Card Number** & a **6-digit PIN**.\n"
|
| 200 |
f"5️⃣ Copy and send the Card Number & PIN to Admin {OWNER_HANDLE}.\n\n"
|
| 201 |
"⚡ Your VIP Plan will be activated within 2 minutes!"
|
| 202 |
)
|
|
@@ -210,7 +206,7 @@ def get_payment_caption(lang: str = "hi"):
|
|
| 210 |
f"👉 [यहाँ क्लिक करके PhonePe गिफ्ट कार्ड खरीदें]({PHONEPE_LINK})\n\n"
|
| 211 |
"2️⃣ PhonePe में **'Buy New Gift Card'** चुनें।\n"
|
| 212 |
"3️⃣ अपने चुने हुए प्लान की सही राशि दर्ज करके पेमेंट पूरा करें।\n"
|
| 213 |
-
"4️⃣ पेमेंट के बाद आपको **16 अंकों का कार्ड नंबर** और **6 अंकों का पिन** मिलेगा।\n"
|
| 214 |
f"5️⃣ वह कार्ड नंबर और पिन कॉपी करके एडमिन {OWNER_HANDLE} को भेजें।\n\n"
|
| 215 |
"⚡ आपका VIP प्लान 2 मिनट के अंदर एक्टिवेट कर दिया जाएगा!"
|
| 216 |
)
|
|
@@ -231,42 +227,44 @@ def get_howtouse_text(lang: str = "hi"):
|
|
| 231 |
"📖 **How to Use the Bot (Step-by-Step Guide):**\n"
|
| 232 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 233 |
"1️⃣ **Step 1 — Connect Account:**\n"
|
| 234 |
-
"• Send `/login` and provide your phone number (`+91XXXXXXXXXX`).\n"
|
| 235 |
"• Enter the OTP code received on Telegram.\n\n"
|
| 236 |
"2️⃣ **Step 2 — Start Transfer:**\n"
|
| 237 |
-
"• Send `/clone`
|
| 238 |
-
"• Send
|
| 239 |
-
"•
|
| 240 |
-
"•
|
| 241 |
-
"
|
| 242 |
-
"
|
| 243 |
-
"
|
|
|
|
| 244 |
"🛑 **Cancel Task:** Send `/cancel` to stop immediately.\n\n"
|
| 245 |
-
"🎥 **Video
|
| 246 |
-
f"👉 [Click here to watch video tutorial]({TUTORIAL_VIDEO_URL})"
|
| 247 |
)
|
| 248 |
return (
|
| 249 |
"📖 **बॉट इस्तेमाल करने के आसान स्टेप्स:**\n"
|
| 250 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 251 |
"1️⃣ **स्टेप 1 — लॉगिन करें:**\n"
|
| 252 |
-
"• `/login` भेजें और कंट्री कोड के साथ
|
| 253 |
"• टेलीग्राम से आया हुआ OTP दर्ज करें।\n\n"
|
| 254 |
"2️⃣ **स्टेप 2 — टास्क शुरू करें:**\n"
|
| 255 |
-
"•
|
| 256 |
-
"• ट
|
| 257 |
-
"•
|
| 258 |
-
"• टारगेट चैनल
|
|
|
|
| 259 |
"3️⃣ **स्टेप 3 — सेटिंग्स & स्टार्ट:**\n"
|
| 260 |
-
"• कैप्शन
|
| 261 |
-
"🔄 **ऑटो-रिज्यूम:** बीच में रुकने पर `/resume` भेजें।\n"
|
| 262 |
"🛑 **रोकने के लिए:** कभी भी `/cancel` भेजें।\n\n"
|
| 263 |
-
"🎥 **वीडियो ट्यूटोरियल देखें:**\n"
|
| 264 |
f"👉 [यहाँ क्लिक करके पूरा वीडियो गाइड देखें]({TUTORIAL_VIDEO_URL})"
|
| 265 |
)
|
| 266 |
|
| 267 |
def get_howtouse_buttons(lang: str = "hi"):
|
| 268 |
vid_txt = "🎥 Watch Tutorial Video" if lang == "en" else "🎥 वीडियो ट्यूटोरियल देखें"
|
| 269 |
-
chan_txt = "📢 Channel
|
| 270 |
back_txt = "🔙 Back to Main Menu" if lang == "en" else "🔙 मुख्य मेन्यू पर लौटें"
|
| 271 |
return InlineKeyboardMarkup([
|
| 272 |
[InlineKeyboardButton(vid_txt, url=TUTORIAL_VIDEO_URL)],
|
|
@@ -277,51 +275,59 @@ def get_howtouse_buttons(lang: str = "hi"):
|
|
| 277 |
def get_channelhelp_text(lang: str = "hi"):
|
| 278 |
if lang == "en":
|
| 279 |
return (
|
| 280 |
-
"📢 **
|
| 281 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 282 |
-
"
|
| 283 |
-
"
|
| 284 |
-
"•
|
| 285 |
-
"
|
| 286 |
-
"
|
| 287 |
-
"•
|
| 288 |
-
"•
|
| 289 |
-
"•
|
| 290 |
-
"💡 **
|
|
|
|
|
|
|
| 291 |
)
|
| 292 |
return (
|
| 293 |
-
"📢 **चैनल
|
| 294 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 295 |
-
"
|
| 296 |
-
"
|
| 297 |
-
"• चैनल क
|
| 298 |
-
"
|
| 299 |
-
"
|
| 300 |
-
"•
|
| 301 |
-
"•
|
| 302 |
-
"•
|
| 303 |
-
"💡 **चैनल
|
|
|
|
|
|
|
| 304 |
)
|
| 305 |
|
| 306 |
def get_speedhelp_text(lang: str = "hi"):
|
| 307 |
if lang == "en":
|
| 308 |
return (
|
| 309 |
-
"⚡ **
|
| 310 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 311 |
-
"Our bot runs on a **
|
| 312 |
-
"
|
| 313 |
-
"1. **
|
| 314 |
-
"2. **
|
| 315 |
-
"
|
|
|
|
|
|
|
| 316 |
)
|
| 317 |
return (
|
| 318 |
-
"⚡ **स्पीड
|
| 319 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 320 |
-
"हमार
|
| 321 |
-
"
|
| 322 |
-
"1. **
|
| 323 |
-
"2. **
|
| 324 |
-
"
|
|
|
|
|
|
|
| 325 |
)
|
| 326 |
|
| 327 |
@bot.on_message(filters.command("start") & filters.private)
|
|
@@ -330,11 +336,6 @@ async def start_command(client: Client, message: Message):
|
|
| 330 |
name = message.from_user.first_name
|
| 331 |
db.add_user(user_id, name)
|
| 332 |
lang = db.get_lang(user_id)
|
| 333 |
-
|
| 334 |
-
from TechVJ.start import is_user_subscribed, send_force_sub_message
|
| 335 |
-
if not is_admin(user_id) and not await is_user_subscribed(client, user_id):
|
| 336 |
-
return await send_force_sub_message(client, message)
|
| 337 |
-
|
| 338 |
text, buttons = get_start_panel(name, is_admin(user_id), lang)
|
| 339 |
await message.reply_text(text, reply_markup=buttons, disable_web_page_preview=True)
|
| 340 |
|
|
@@ -424,20 +425,7 @@ async def bot_callback_router(client: Client, query: CallbackQuery):
|
|
| 424 |
name = query.from_user.first_name
|
| 425 |
lang = db.get_lang(user_id)
|
| 426 |
|
| 427 |
-
if data
|
| 428 |
-
from TechVJ.start import is_user_subscribed
|
| 429 |
-
if await is_user_subscribed(client, user_id):
|
| 430 |
-
await query.answer("✅ शुक्रिया! आपने चैनल जॉइन कर लिया है।", show_alert=True)
|
| 431 |
-
text, buttons = get_start_panel(name, is_admin(user_id), lang)
|
| 432 |
-
try:
|
| 433 |
-
await query.message.edit_text(text, reply_markup=buttons, disable_web_page_preview=True)
|
| 434 |
-
except Exception:
|
| 435 |
-
pass
|
| 436 |
-
else:
|
| 437 |
-
await query.answer("❌ आपने अभी तक चैनल जॉइन नहीं किया है! कृपया पहले चैनल जॉइन करें।", show_alert=True)
|
| 438 |
-
return
|
| 439 |
-
|
| 440 |
-
elif data.startswith("setlang_"):
|
| 441 |
new_lang = data.split("_")[1]
|
| 442 |
db.set_lang(user_id, new_lang)
|
| 443 |
confirm_txt = "✅ **Language changed to English!**" if new_lang == "en" else "✅ **भाषा बदलकर हिंदी कर दी गई है!**"
|
|
@@ -702,13 +690,14 @@ async def add_user_admin(client: Client, message: Message):
|
|
| 702 |
try:
|
| 703 |
await client.send_message(
|
| 704 |
target_id,
|
| 705 |
-
f"🎉 **बधाई हो!** आपका VIP सब्सक्रिप्शन एक्टिवेट कर दिया गया है ({days} दिन के लिए)।\nअब आप `/clone`
|
| 706 |
)
|
| 707 |
except Exception:
|
| 708 |
pass
|
| 709 |
except Exception as e:
|
| 710 |
await message.reply_text(f"Error: {e}")
|
| 711 |
|
|
|
|
| 712 |
@bot.on_message(filters.command("removeuser") & filters.private)
|
| 713 |
async def remove_user_admin(client: Client, message: Message):
|
| 714 |
if not is_admin(message.from_user.id):
|
|
@@ -720,6 +709,7 @@ async def remove_user_admin(client: Client, message: Message):
|
|
| 720 |
target_id = int(parts[1])
|
| 721 |
db.remove_vip_user(target_id)
|
| 722 |
|
|
|
|
| 723 |
try:
|
| 724 |
from TechVJ.start import batch_temp
|
| 725 |
batch_temp.IS_BATCH[target_id] = True
|
|
|
|
| 4 |
from pyrogram import Client, filters
|
| 5 |
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
|
| 6 |
from pyrogram.errors import FloodWait, UserIsBlocked, InputUserDeactivated
|
| 7 |
+
from config import API_ID, API_HASH, BOT_TOKEN, ADMINS, OWNER_HANDLE, SUPPORT_GROUP
|
| 8 |
from db import db
|
| 9 |
|
| 10 |
try:
|
|
|
|
| 27 |
bot_token=BOT_TOKEN,
|
| 28 |
plugins=dict(root="TechVJ"),
|
| 29 |
workers=150,
|
| 30 |
+
max_concurrent_transmissions=16,
|
| 31 |
sleep_threshold=5
|
| 32 |
)
|
| 33 |
|
|
|
|
| 63 |
f"👋 **Welcome to Save Restricted Content Bot!**{admin_tag}\n"
|
| 64 |
"━━━━━━━━━━━━━━━━━━━━\n\n"
|
| 65 |
"Clone or forward files from any **private or public** Telegram channel/group — "
|
| 66 |
+
"even if forwarding is restricted. Topics/Threads are fully supported.\n\n"
|
|
|
|
| 67 |
"✅ Dedicated 1 GB RAM per user\n"
|
| 68 |
+
"✅ Forward-restricted channel/group supported\n"
|
| 69 |
+
"✅ Topics/Threads groups supported\n"
|
| 70 |
+
"✅ 2GB+ files · Smart caption & filename editing\n"
|
| 71 |
+
"✅ Custom transfer thumbnail support\n\n"
|
|
|
|
| 72 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 73 |
"Select an option from the menu below:"
|
| 74 |
)
|
|
|
|
| 79 |
],
|
| 80 |
[
|
| 81 |
InlineKeyboardButton("📖 User Guide & Video", callback_data="nav_howtouse"),
|
| 82 |
+
InlineKeyboardButton("📢 Channel Upload Guide", callback_data="nav_channelhelp")
|
| 83 |
],
|
| 84 |
[
|
| 85 |
+
InlineKeyboardButton("⚡ Slow Speed Reason?", callback_data="nav_speedhelp"),
|
| 86 |
InlineKeyboardButton("📊 My Status", callback_data="nav_myplan")
|
| 87 |
],
|
| 88 |
[
|
|
|
|
| 98 |
text = (
|
| 99 |
f"👋 **Welcome to Save Restricted Content Bot!**{admin_tag}\n"
|
| 100 |
"━━━━━━━━━━━━━━━━━━━━\n\n"
|
| 101 |
+
"Kisi bhi **private ya public** Telegram channel/group se files clone karo — "
|
| 102 |
+
"chahe **forwarding band (Restricted)** ho tab bhi. Topics/Threads bhi supported hain.\n\n"
|
|
|
|
| 103 |
"✅ Dedicated 1 GB RAM per user\n"
|
| 104 |
+
"✅ Forward-restricted channel/group supported\n"
|
| 105 |
+
"✅ Topics/Threads groups supported\n"
|
| 106 |
+
"✅ 2GB+ files · Smart caption & filename editing\n"
|
| 107 |
+
"✅ Custom transfer thumbnail support\n\n"
|
|
|
|
| 108 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 109 |
"नीचे दिए गए मेन्यू में से विकल्प चुनें:"
|
| 110 |
)
|
|
|
|
| 115 |
],
|
| 116 |
[
|
| 117 |
InlineKeyboardButton("📖 बॉट कैसे चलाएं (गाइड & वीडियो)", callback_data="nav_howtouse"),
|
| 118 |
+
InlineKeyboardButton("📢 चैनल में अपलोड कैसे करें?", callback_data="nav_channelhelp")
|
| 119 |
],
|
| 120 |
[
|
| 121 |
+
InlineKeyboardButton("⚡ स्पीड कम क्यों मिल रही है?", callback_data="nav_speedhelp"),
|
| 122 |
InlineKeyboardButton("📊 मेरा स्टेटस", callback_data="nav_myplan")
|
| 123 |
],
|
| 124 |
[
|
|
|
|
| 149 |
f"🔹 **30 Days (Monthly Unlimited):** ₹{plans.get('30days', '199')}\n\n"
|
| 150 |
"🔥 **Features Included in All Plans:**\n"
|
| 151 |
"• Unlimited files, videos & PDFs transfer\n"
|
| 152 |
+
"• 16 parallel workers high-speed download/upload\n"
|
| 153 |
+
"• 2GB+ file support with custom thumbnails\n"
|
| 154 |
+
"• Auto-caption replace & forum topics support\n"
|
| 155 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 156 |
"Click **'💳 How to Pay'** below to activate."
|
| 157 |
)
|
|
|
|
| 164 |
f"🔹 **30 दिन (मंथली अनलिमिटेड):** ₹{plans.get('30days', '199')}\n\n"
|
| 165 |
"🔥 **सभी प्लान्स में शामिल:**\n"
|
| 166 |
"• अनलिमिटेड फाइल्स, वीडियो व PDFs ट्रांसफर\n"
|
| 167 |
+
"• 16 पैरेलल वर्कर्स सुपरफास्ट डाउनलोड/अपलोड\n"
|
| 168 |
+
"• 2GB+ फ़ाइल सपोर्ट व कस्टम थंबनेल\n"
|
| 169 |
+
"• ऑटो-कैप्शन रिप्लेस व टॉपिक ग्रुप सपोर्ट\n"
|
| 170 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 171 |
"पेमेंट करने के लिए नीचे **'💳 पेमेंट कैसे करें'** बटन दबाएँ।"
|
| 172 |
)
|
|
|
|
| 192 |
f"👉 [Click here to buy PhonePe Gift Card]({PHONEPE_LINK})\n\n"
|
| 193 |
"2️⃣ In PhonePe, select **'Buy New Gift Card'**.\n"
|
| 194 |
"3️⃣ Enter the exact amount for your chosen plan & complete the payment.\n"
|
| 195 |
+
"4️⃣ After payment, you will receive a **16-digit Card Number** & a **6-digit PIN** (as shown in the image above).\n"
|
| 196 |
f"5️⃣ Copy and send the Card Number & PIN to Admin {OWNER_HANDLE}.\n\n"
|
| 197 |
"⚡ Your VIP Plan will be activated within 2 minutes!"
|
| 198 |
)
|
|
|
|
| 206 |
f"👉 [यहाँ क्लिक करके PhonePe गिफ्ट कार्ड खरीदें]({PHONEPE_LINK})\n\n"
|
| 207 |
"2️⃣ PhonePe में **'Buy New Gift Card'** चुनें।\n"
|
| 208 |
"3️⃣ अपने चुने हुए प्लान की सही राशि दर्ज करके पेमेंट पूरा करें।\n"
|
| 209 |
+
"4️⃣ पेमेंट के बाद आपको **16 अंकों का कार्ड नंबर** और **6 अंकों का पिन** मिलेगा (जैसा ऊपर फोटो में दिखाया गया है)।\n"
|
| 210 |
f"5️⃣ वह कार्ड नंबर और पिन कॉपी करके एडमिन {OWNER_HANDLE} को भेजें।\n\n"
|
| 211 |
"⚡ आपका VIP प्लान 2 मिनट के अंदर एक्टिवेट कर दिया जाएगा!"
|
| 212 |
)
|
|
|
|
| 227 |
"📖 **How to Use the Bot (Step-by-Step Guide):**\n"
|
| 228 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 229 |
"1️⃣ **Step 1 — Connect Account:**\n"
|
| 230 |
+
"• Send `/login` and provide your phone number with country code (`+91XXXXXXXXXX`).\n"
|
| 231 |
"• Enter the OTP code received on Telegram.\n\n"
|
| 232 |
"2️⃣ **Step 2 — Start Transfer:**\n"
|
| 233 |
+
"• Send `/clone`.\n"
|
| 234 |
+
"• Send the starting post link.\n"
|
| 235 |
+
"• Send the ending post link (or `/single` for one file).\n"
|
| 236 |
+
"• Send target channel ID or username (or `/skip` to receive directly in bot DM).\n"
|
| 237 |
+
"💡 *For forum topics, provide ID as `-100xxxx:topic_id`*\n\n"
|
| 238 |
+
"3️⃣ **Step 3 — Settings & Confirmation:**\n"
|
| 239 |
+
"• Set custom captions or thumbnails, then click **Confirm & Start**!\n\n"
|
| 240 |
+
"🔄 **Resume Task:** If interrupted, send `/resume` to continue.\n"
|
| 241 |
"🛑 **Cancel Task:** Send `/cancel` to stop immediately.\n\n"
|
| 242 |
+
"🎥 **Watch Video Walkthrough:**\n"
|
| 243 |
+
f"👉 [Click here to watch the full video tutorial]({TUTORIAL_VIDEO_URL})"
|
| 244 |
)
|
| 245 |
return (
|
| 246 |
"📖 **बॉट इस्तेमाल करने के आसान स्टेप्स:**\n"
|
| 247 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 248 |
"1️⃣ **स्टेप 1 — लॉगिन करें:**\n"
|
| 249 |
+
"• `/login` कमांड भेजें और अपना नंबर कंट्री कोड के साथ डालें (`+91XXXXXXXXXX`)।\n"
|
| 250 |
"• टेलीग्राम से आया हुआ OTP दर्ज करें।\n\n"
|
| 251 |
"2️⃣ **स्टेप 2 — टास्क शुरू करें:**\n"
|
| 252 |
+
"• `/clone` कमांड भेजें।\n"
|
| 253 |
+
"• स्टार्ट लिंक (जहाँ से शुरू करना है) भेजें।\n"
|
| 254 |
+
"• एंड लिंक भेजें (सिंगल पोस्ट के लिए `/single` लिखें)।\n"
|
| 255 |
+
"• टारगेट चैनल की ID/लिंक भेजें (सीधे बॉट में पाने के लिए `/skip` लिखें)।\n"
|
| 256 |
+
"💡 *फोरम ग्रुप के लिए `-100xxxx:टॉपिक_ID` फॉर्मेट का इस्तेमाल करें।*\n\n"
|
| 257 |
"3️⃣ **स्टेप 3 — सेटिंग्स & स्टार्ट:**\n"
|
| 258 |
+
"• अपना कस्टम कैप्शन या थंबनेल सेट करें और **Confirm & Start** दबा दें!\n\n"
|
| 259 |
+
"🔄 **ऑटो-रिज्यूम:** टास्क बीच में रुकने पर `/resume` भेजें।\n"
|
| 260 |
"🛑 **रोकने के लिए:** कभी भी `/cancel` भेजें।\n\n"
|
| 261 |
+
"🎥 **स्टेप-बाय-स्टेप वीडियो ट्यूटोरियल देखें:**\n"
|
| 262 |
f"👉 [यहाँ क्लिक करके पूरा वीडियो गाइड देखें]({TUTORIAL_VIDEO_URL})"
|
| 263 |
)
|
| 264 |
|
| 265 |
def get_howtouse_buttons(lang: str = "hi"):
|
| 266 |
vid_txt = "🎥 Watch Tutorial Video" if lang == "en" else "🎥 वीडियो ट्यूटोरियल देखें"
|
| 267 |
+
chan_txt = "📢 Channel Upload Guide" if lang == "en" else "📢 चैनल में अपलोड गाइड"
|
| 268 |
back_txt = "🔙 Back to Main Menu" if lang == "en" else "🔙 मुख्य मेन्यू पर लौटें"
|
| 269 |
return InlineKeyboardMarkup([
|
| 270 |
[InlineKeyboardButton(vid_txt, url=TUTORIAL_VIDEO_URL)],
|
|
|
|
| 275 |
def get_channelhelp_text(lang: str = "hi"):
|
| 276 |
if lang == "en":
|
| 277 |
return (
|
| 278 |
+
"📢 **How to Upload Files to Your Channel/Group?**\n"
|
| 279 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 280 |
+
"If you want files uploaded directly into your channel or group, complete these 2 steps:\n\n"
|
| 281 |
+
"🔹 **Step 1: Make Bot & Account Admin**\n"
|
| 282 |
+
"• Go to Channel Settings ➔ **Administrators** ➔ **Add Admin**.\n"
|
| 283 |
+
"• Add our bot and your logged-in Telegram account with **Full Admin Rights** (Post & Edit Messages).\n\n"
|
| 284 |
+
"🔹 **Step 2: Get the Channel ID**\n"
|
| 285 |
+
"• **Public Channel:** Send the username directly (e.g., `@MyChannelName`).\n"
|
| 286 |
+
"• **Private Channel:** Must start with `-100` (e.g., `-1001234567890`).\n"
|
| 287 |
+
"• **Topic Group:** Send as `-1001234567890:45` (where 45 is the Topic ID).\n\n"
|
| 288 |
+
"💡 **How to find Channel ID:**\n"
|
| 289 |
+
"Forward any message from your channel to this bot and send `/id`. The bot will display the exact `-100` ID!\n\n"
|
| 290 |
+
"⚠️ **Note:** Telegram will block file uploads if admin permissions are missing."
|
| 291 |
)
|
| 292 |
return (
|
| 293 |
+
"📢 **अपने चैनल/ग्रुप में फाइल्स कैसे अपलोड करवाएं?**\n"
|
| 294 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 295 |
+
"यदि आप चाहते हैं कि बॉट फाइल्स सीधे आपके अपने चैनल या ग्रुप में अपलोड करे, तो ये 2 स्टेप्स पूरे करें:\n\n"
|
| 296 |
+
"🔹 **स्टेप 1: बॉट और अपने अकाउंट को एडमिन बनाएं**\n"
|
| 297 |
+
"• अपने चैनल/ग्रुप की सेटिंग्स ➔ **Administrators** ➔ **Add Admin** में जाएँ।\n"
|
| 298 |
+
"• हमारे बॉट और अपने लॉगिन किए गए टेलीग्राम नंबर दोनों को **Full Admin Rights** (Post & Edit Messages) दें।\n\n"
|
| 299 |
+
"��� **स्टेप 2: सही चैनल ID कैसे डालें?**\n"
|
| 300 |
+
"• **पब्लिक चैनल के लिए:** सीधे यूज़रनेम डालें (उदा: `@MyChannelName`)\n"
|
| 301 |
+
"• **प्राइवेट चैनल के लिए:** हमेशा `-100` से शुरू होने वाली ID डालें (उदा: `-1001234567890`)\n"
|
| 302 |
+
"• **टॉपिक ग्रुप के लिए:** `-1001234567890:45` फॉर्मेट में भेजें (जहाँ 45 टॉपिक ID है)\n\n"
|
| 303 |
+
"💡 **चैनल ID निकालने का तरीका:**\n"
|
| 304 |
+
"अपने चैनल का कोई भी एक मैसेज इस बॉट में फॉरवर्ड करें और `/id` कमांड भेजें। बॉट आपको चैनल की सही `-100` वाली ID बता देगा!\n\n"
|
| 305 |
+
"⚠️ **नोट:** बिना एडमिन परमिशन के टेलीग्राम फ़ाइल पोस्ट करने की अनुमति नहीं देता।"
|
| 306 |
)
|
| 307 |
|
| 308 |
def get_speedhelp_text(lang: str = "hi"):
|
| 309 |
if lang == "en":
|
| 310 |
return (
|
| 311 |
+
"⚡ **Why is the Speed Slower? (Clarification)**\n"
|
| 312 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 313 |
+
"Our bot runs on a **16-Worker Parallel Engine** with a dedicated 1 Gbps cloud network pipe. There is zero speed bottleneck from our bot or server side.\n\n"
|
| 314 |
+
"🔍 **Actual Reasons for Slower Speed:**\n"
|
| 315 |
+
"1. **Telegram Server Rate-Limit:** If large files were transferred recently on your account, Telegram imposes a temporary server-side rate limit (down to 500 KB/s).\n"
|
| 316 |
+
"2. **Non-Premium Account Cap:** Official Telegram rules enforce a strict upload speed throttle (1.5 - 2.5 MB/s) on free accounts.\n\n"
|
| 317 |
+
"💡 **How to Get High Speed (8 - 10 MB/s+):**\n"
|
| 318 |
+
"• `/logout` and log in with a fresh Telegram account. Speed will immediately jump back to maximum.\n"
|
| 319 |
+
"• Using a **Telegram Premium** account removes all server throttles (10 - 15 MB/s+)."
|
| 320 |
)
|
| 321 |
return (
|
| 322 |
+
"⚡ **स्पीड कम क्यों मिल रही है? (Slow Speed Clarification)**\n"
|
| 323 |
"━━━━━━━━━━━━━━━━━━━━\n"
|
| 324 |
+
"हमारे बॉट और सर्वर में **16 पैरेलल वर्कर्स (High-Speed Engine)** और 1 Gbps का अल्ट्रा-फास्ट नेटवर्क पाइप सक्रिय है। हमारे सर्वर या बॉट की तरफ से स्पीड में कोई कमी या समस्या नहीं है।\n\n"
|
| 325 |
+
"🔍 **धीमी स्पीड की मुख्य वजहें:**\n"
|
| 326 |
+
"1. **टेलीग्राम सर्वर पाबंदी (Rate-Limit):** अगर आपके टेलीग्राम अकाउंट से हाल ही में लगातार बहुत सारा डेटा ट्रांसफर हुआ है, तो टेलीग्राम उस अकाउंट पर अस्थायी रूप से सर्वर-साइड स्पीड कैप (600 KB/s) लगा देता है।\n"
|
| 327 |
+
"2. **मुफ़्त (Free) टेलीग्राम लिमिट:** टेलीग्राम के आधिकारिक नियमों के तहत फ्री अकाउंट्स पर अपलोड स्पीड को उनके डेटा सेंटर द्वारा 1.5 से 2.5 MB/s पर सीमित रखा जाता है।\n\n"
|
| 328 |
+
"💡 **पूरी स्पीड (8 से 10 MB/s+) पाने के तरीके:**\n"
|
| 329 |
+
"• बॉट में `/logout` करके किसी दूसरे बिल्कुल साफ़ या नए नंबर से `/login` करें। आपको तुरंत फ़ुल स्पीड मिलने लगेगी।\n"
|
| 330 |
+
"• यदि आप **Telegram Premium** अकाउंट से लॉगिन करेंगे, तो स्पीड अनकैप्ड (10 से 15 MB/s+) हो जाएगी।"
|
| 331 |
)
|
| 332 |
|
| 333 |
@bot.on_message(filters.command("start") & filters.private)
|
|
|
|
| 336 |
name = message.from_user.first_name
|
| 337 |
db.add_user(user_id, name)
|
| 338 |
lang = db.get_lang(user_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
text, buttons = get_start_panel(name, is_admin(user_id), lang)
|
| 340 |
await message.reply_text(text, reply_markup=buttons, disable_web_page_preview=True)
|
| 341 |
|
|
|
|
| 425 |
name = query.from_user.first_name
|
| 426 |
lang = db.get_lang(user_id)
|
| 427 |
|
| 428 |
+
if data.startswith("setlang_"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
new_lang = data.split("_")[1]
|
| 430 |
db.set_lang(user_id, new_lang)
|
| 431 |
confirm_txt = "✅ **Language changed to English!**" if new_lang == "en" else "✅ **भाषा बदलकर हिंदी कर दी गई है!**"
|
|
|
|
| 690 |
try:
|
| 691 |
await client.send_message(
|
| 692 |
target_id,
|
| 693 |
+
f"🎉 **बधाई हो!** आपका VIP सब्सक्रिप्शन एक्टिवेट कर दिया गया है ({days} दिन के लिए)।\nअब आप `/clone` कमांड का उपयोग कर सकते हैं।"
|
| 694 |
)
|
| 695 |
except Exception:
|
| 696 |
pass
|
| 697 |
except Exception as e:
|
| 698 |
await message.reply_text(f"Error: {e}")
|
| 699 |
|
| 700 |
+
# 🛑 पावरफुल रिमूव यूजर कमांड (लाइव टास्क को तुरंत किल करेगा)
|
| 701 |
@bot.on_message(filters.command("removeuser") & filters.private)
|
| 702 |
async def remove_user_admin(client: Client, message: Message):
|
| 703 |
if not is_admin(message.from_user.id):
|
|
|
|
| 709 |
target_id = int(parts[1])
|
| 710 |
db.remove_vip_user(target_id)
|
| 711 |
|
| 712 |
+
# मेमोरी से तुरंत टास्क रोकने का ट्रिगर
|
| 713 |
try:
|
| 714 |
from TechVJ.start import batch_temp
|
| 715 |
batch_temp.IS_BATCH[target_id] = True
|