"• /search - Search the database\n"
            "• /status - Check your subscription\n\n"
            "💡 Need help? Contact @anetjaka"
        )
    else:
        bot.send_message(message.chat.id, 
            "❌ Key Redemption Failed\n"
            "━━━━━━━━━━━━━━━\n\n"
            f"Reason: {response_message}\n\n"
            "💡 Need a valid key? Contact @anetjaka"
        )
@bot.message_handler(commands=['help'])
def help_command(message):
    user_id = str(message.from_user.id)
    if not is_user_authorized(user_id):
        help_message = (
            "🔐 Help: Access Restricted\n"
            "━━━━━━━━━━━━━━━━━━━━━\n\n"
            "To access bot features, you need an active key:\n\n"
            "• 🎫 Use /redeem to activate your key\n"
            "• 💡 Need a key? Contact @anetjaka\n\n"
            "Key Benefits:\n"
            "✅ Unlimited database searches\n"
            "✅ Secure and confidential access\n"
            "✅ Regular database updates"
        )
        bot.send_message(message.chat.id, help_message)
        return
    help_message = (
        "🤖 Bot Command Guide\n"
        "━━━━━━━━━━━━━━━━\n\n"
        "Available Commands:\n\n"
        "🔍 /search\n"
        "   • Search the database\n"
        "   • Find accounts by keywords\n"
        "   • Returns up to 200 random results\n\n"
        "📊 /status\n"
        "   • Check your subscription details\n"
        "   • View remaining time\n"
        "   • See total searches\n"
        "   • Check active users\n\n"
        "🔑 /redeem\n"
        "   • Activate a new access key\n"
        "   • Required for bot usage\n\n"
        "💡 Tips:\n"
        "   • Keep your key safe\n"
        "   • Renew before expiration\n"
        "   • Contact @anetjaka for support\n\n"
        "⚠️ Usage Policy:\n"
        "   • Respect database integrity\n"
        "   • No illegal activities\n"
        "   • Ethical use only"
    )
    bot.send_message(message.chat.id, help_message)
@bot.message_handler(commands=['gen'])
def generate_keys_command(message):
    if message.from_user.username != 'anetjaka':
        bot.reply_to(message, "⛔ This command is restricted to admin use only.")
        return
    msg = bot.reply_to(message, "How many keys do you want to generate?")
    bot.register_next_step_handler(msg, process_num_keys)
def process_num_keys(message):
    try:
        num_keys = int(message.text.strip())
        if num_keys <= 0:
            bot.reply_to(message, "Please provide a positive number of keys.")
            return
        user_data[message.from_user.id] = {'num_keys': num_keys}
        msg = bot.reply_to(message, f"You want to generate {num_keys} keys.\nHow many days should these keys be valid for?")
        bot.register_next_step_handler(msg, process_validity_days)
    except ValueError:
        bot.reply_to(message, "Please provide a valid number. Use /genkeys to start over.")
def process_validity_days(message):
    try:
        validity_days = int(message.text.strip())
        if validity_days <= 0:
            bot.reply_to(message, "Please provide a positive number of days.")
            return
        user_id = message.from_user.id
        if user_id not in user_data:
            bot.reply_to(message, "Session expired. Please use /genkeys to start over.")
            return
        num_keys = user_data[user_id]['num_keys']
        markup = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=True)
        markup.add('Yes', 'No')
        confirm_message = f"📝 Summary:\n" \
                         f"Number of keys: {num_keys}\n" \