Project Title: Python Telegram Bot Expert - Security & Logic Hardening (Fixed Budget $50)

Job ID: 40378753

Budget: $10 – $30 USD

Project Description:
I am looking for a professional Python developer to optimize and secure an existing Telegram Reward Bot. The bot is built using pyTelegramBotAPI (Telebot), Flask, and Firebase Real-time Database.
The core structure (511 lines of code) is already functional. I do NOT need a bot from scratch. I only need an expert to fix 5 specific logic gaps to ensure the bot acts with "AI-level precision" and prevents any user fraud.
Key Deliverables (The Fixes):
Strict Input Validation (Regex): Secure the Wallet Binding system. The bot must reject any text that doesn't strictly match the required format (Name, Acc Type, 11-digit Number for PKR / 34-char 'T' prefix for TRX).
Withdrawal Logic Hardening: Fix the "Withdraw Funds" button. It must perform real-time balance checks against Firebase and only accept integer inputs that meet minimum thresholds (PKR 2,000 / TRX 12,000).
Referral Milestone Condition: Modify the referral reward system. The 150-coin reward should ONLY be credited to the inviter AFTER the new referral completes at least 3 tasks (tracked via tasks_count in Firebase).
Admin Control Extension: Add /deductcoins [user_id] [amount] and /banuser [user_id] commands to the existing admin panel.
Auto-Reminder Scheduler: Optimize the current reminder thread to ensure it sends a 24-hour inactivity reminder accurately based on the user's last task time.
Navigation Flow: Fix the "Back Button" logic to ensure the menu never disappears if a user types an invalid command.
Technical Requirements:
Expert in Python & Firebase RTDB.
Strong understanding of Input Sanitization and State Handling.
Ability to work within the existing 511-line codebase without deleting or breaking current functions.
Budget: Fixed $20 - $40.
Timeline: 1-2 Days.
Note: I have the source code ready. Place your bid only if you can work within this budget. Generic $100 to $150+ bids will be ignored.