Кабинет

Посты канала Esko Coding

сначала новые

#897Текст

🚫 Multi-Account Banning Code - TPY Command: /start # Check whether the user is banned ban_status = User.getData("ban") if ban_status == "ok":     raise ReturnCommand() # Check whether the user has completed captcha verification verification_status = User.getData("verify") if not verification_status:     bot.runCommand("/verify")     raise ReturnCommand() Command: verify #  Generate a secure webhook URL webhook_url = libs.Webhook.getUrlFor(     command="onWebhook",     user_id=u ) # Build captcha verification page URL captcha_url = (     "https://esko-capcha.vercel.app/captcha/verify"     "?webhookUrl=" + str(encodeURIComponent(webhook_url)) ) # Verification button keys = [     [         InlineKeyboardButton(             text="➡️  Verify Captcha",             web_app=captcha_url         )     ] ] keyboard = InlineKeyboardMarkup(keys) # Verification message verification_message = """ <b>🛡️ Verification Required</b> To continue using the bot, please complete the captcha below. ⚠️ <b>Important:</b> • Do not use multiple accounts. • Do not use a VPN or proxy. • Suspicious activity may result in an automatic ban. 👇 <b>Tap the button below to verify.</b> """ bot.sendMessage(     verification_message,     reply_markup=keyboard ) Command: onWebhook # Validate webhook request if options == None:     bot.replyText(         u,         "❌ <b>Access Denied</b>\n\n"         "This verification request is not valid.",         parse_mode="HTML"     )     raise ReturnCommand() # Parse webhook data data = bunchify(options.json) user_hash = data["results"]["user_hash"] captcha_status = data["results"]["captcha"] vpn_status = data["results"]["vpn"] # Prevent duplicate verification verification_status = User.getData("verify") if verification_status:     raise ReturnCommand() # VPN DETECTION if vpn_status == "yes":     bot.sendMessage(         """ <b>🚨 Verification Failed</b> Your connection appears to be using a VPN or proxy. For security reasons, you have been <b>banned</b> from using this bot. """,         parse_mode="HTML"     )     # Ban user     User.saveData("ban", "ok")     raise ReturnCommand() # Load previously used verification hashes stored_hashes = Bot.getData("hashs") if stored_hashes == None:     stored_hashes = [] # Detect multiple accounts if stored_hashes.count(user_hash) > 0:     bot.sendMessage(         """ <b>🚫 Multiple Account Detected</b> This verification fingerprint has already been used by another account. For security reasons, your account has been <b>banned</b>. """,         parse_mode="HTML"     )     # Ban user     User.saveData("ban", "ok")     raise ReturnCommand() # CAPTCHA SUCCESS if captcha_status == "ok":     # Save verification fingerprint     stored_hashes.append(user_hash)     Bot.saveData("hashs", stored_hashes)     # Mark user as verified     User.saveData("verify", "ok")     # Successful verification message     bot.sendMessage(         """ <b>🎉 Verification Successful!</b> Your account has been successfully verified. ✅ You can now use the bot normally. 👉 Send <b>/start</b> to continue. """,         parse_mode="HTML"     )     # Restart the start command     Bot.runCommand("/start") Channel: @EskoCoding ©️Copyright Free Code

Открыть в Telegram
Просмотры1 200+38%к среднему
Пересылки—
Реакции11
Комментарии—
#273Фото
Просмотры7 390+749%к среднему
Пересылки—
Реакции5
Комментарии—
#270Текст
Просмотры1 930+122%к среднему
Пересылки—
Реакции3
Комментарии—