package com.mhss.app.mybrain.presentation.tgbot import kotlinx.serialization.Serializable @Serializable data class TgBot( val id: Long, val name: String, val username: String, val token: String, val canJoinGroups: Boolean = false, val canReadAllGroupMessages: Boolean = false, val supportsInlineQueries: Boolean = false, val userCount: Int = 142, val maxUsers: Int = 500, val messagesSentCount: Long = 1840L, val isOnline: Boolean = true, val healthStats: BotHealthStats = BotHealthStats(), val modulesConfig: TgModulesConfig = TgModulesConfig(), val recentActivities: List = listOf( BotActivityItem("1", System.currentTimeMillis() - 1000 * 60 * 15, "JOIN", "User @alex joined the bot"), BotActivityItem("2", System.currentTimeMillis() - 1000 * 60 * 45, "BROADCAST", "Broadcast campaign sent to 85 active users"), BotActivityItem("3", System.currentTimeMillis() - 1000 * 60 * 90, "F_SUB", "Channel membership verified for 12 new users"), BotActivityItem("4", System.currentTimeMillis() - 1000 * 60 * 180, "MODULE", "Welcome greeting message updated") ), val createdAt: Long = 0L ) { val maskedToken: String get() = if (token.length > 10) { "${token.take(6)}...${token.takeLast(4)}" } else { "******" } val telegramLink: String get() = if (username.isNotBlank()) "https://t.me/$username" else "" } @Serializable data class BotHealthStats( val latencyMs: Long = 95L, val statusText: String = "Online and Responsive", val lastPingTimestamp: Long = 0L, val isHealthy: Boolean = true, val gatewayStatus: String = "HTTP 200 OK • Gateway Healthy" ) @Serializable data class TgModulesConfig( val welcome: WelcomeModuleConfig = WelcomeModuleConfig(), val broadcast: BroadcastModuleConfig = BroadcastModuleConfig(), val forceJoin: ForceJoinModuleConfig = ForceJoinModuleConfig(), val logs: LogsModuleConfig = LogsModuleConfig(), val aiResponder: ProModuleConfig = ProModuleConfig("ai_responder", "AI Smart Auto-Responder", false), val paymentGateway: ProModuleConfig = ProModuleConfig("payment_gateway", "UPI and Payment Gateway", false), val redeemCodes: ProModuleConfig = ProModuleConfig("redeem_codes", "Vouchers and Redeem Codes", false), val multiForceJoin: ProModuleConfig = ProModuleConfig("multi_force_join", "Multi-Channel Force Join (5 Channels)", false) ) @Serializable data class WelcomeModuleConfig( val isEnabled: Boolean = true, val messageText: String = "Welcome to our Bot!\nUse the buttons below to explore our features and services.", val mediaUrl: String? = null, val button1Text: String = "Join Updates Channel", val button1Url: String = "https://t.me/telegram", val button2Text: String = "Help and Support", val button2Url: String = "https://t.me/BotFather" ) @Serializable data class ForceJoinModuleConfig( val isEnabled: Boolean = false, val channelUsername: String = "@my_official_channel", val channelTitle: String = "Official Updates Channel", val promptMessage: String = "You must join our channel to use this bot.\nPlease join below and tap Check Join.", val isVerifiedAdmin: Boolean = true ) @Serializable data class BroadcastModuleConfig( val isEnabled: Boolean = true, val totalBroadcastsSent: Int = 12, val lastBroadcastTimestamp: Long = 0L, val lastDeliveredCount: Int = 142 ) @Serializable data class LogsModuleConfig( val isEnabled: Boolean = true, val maxLogEntries: Int = 100, val entries: List = listOf( BotLogEntry("log-1", System.currentTimeMillis() - 1000 * 60 * 5, "INFO", "/start command triggered", "User ID: 94820194, Chat type: private"), BotLogEntry("log-2", System.currentTimeMillis() - 1000 * 60 * 20, "SUCCESS", "Broadcast delivered", "Delivered to 142 recipients without errors"), BotLogEntry("log-3", System.currentTimeMillis() - 1000 * 60 * 55, "INFO", "FSub check passed", "Verified membership in @my_official_channel"), BotLogEntry("log-4", System.currentTimeMillis() - 1000 * 60 * 120, "INFO", "Telegram API getMe ping", "Roundtrip latency: 95ms") ) ) @Serializable data class ProModuleConfig( val id: String, val name: String, val isEnabled: Boolean = false, val isPro: Boolean = true ) @Serializable data class BotLogEntry( val id: String, val timestamp: Long, val level: String = "INFO", val title: String, val details: String ) @Serializable data class BotActivityItem( val id: String, val timestamp: Long, val type: String, val description: String ) @Serializable data class TelegramGetMeResponse( val ok: Boolean, val result: TelegramBotResult? = null, val description: String? = null ) @Serializable data class TelegramBotResult( val id: Long, val is_bot: Boolean = true, val first_name: String, val username: String? = null, val can_join_groups: Boolean? = null, val can_read_all_group_messages: Boolean? = null, val supports_inline_queries: Boolean? = null ) @Serializable data class ReadyToUseBotTemplate( val id: String, val title: String, val category: String, val description: String, val price: String, val isPro: Boolean = true, val features: List ) @Serializable data class SubscriptionPlan( val id: String, val name: String, val priceFormatted: String, val period: String, val botLimitText: String, val userLimitText: String, val features: List, val isCurrent: Boolean = false, val isPopular: Boolean = false ) object BotCatalogData { val readyToUseTemplates = listOf( ReadyToUseBotTemplate( id = "store_bot", title = "Store and E-Commerce Bot", category = "Commercial", description = "Complete shopping cart, catalog, order management and instant checkout via Telegram.", price = "INR 499 / mo", isPro = true, features = listOf("Product Catalog and Categories", "Shopping Cart and Checkout", "UPI and Card Payment Gateway", "Order Status Notifications") ), ReadyToUseBotTemplate( id = "vip_channel_bot", title = "VIP Channel and Paid Access Bot", category = "Monetization", description = "Automate paid member subscriptions with single-use invite links and auto-removal on expiry.", price = "INR 499 / mo", isPro = true, features = listOf("Automatic Single-Use Invite Links", "Subscription Expiry Tracking", "Automated User Kicking", "Monthly and Annual Billing") ), ReadyToUseBotTemplate( id = "ai_assistant_bot", title = "AI Smart Assistant Bot", category = "Artificial Intelligence", description = "Conversational AI assistant powered by Google Gemini and ChatGPT for 24/7 intelligent customer interactions.", price = "INR 499 / mo", isPro = true, features = listOf("Context-Aware AI Replies", "Custom Knowledge Base Training", "Multi-Language Support", "Real-Time Query Resolution") ), ReadyToUseBotTemplate( id = "support_ticket_bot", title = "Customer Support and Ticket Bot", category = "Customer Service", description = "Route incoming inquiries into structured support tickets with multi-agent replies.", price = "INR 499 / mo", isPro = true, features = listOf("Ticket Queue Management", "Agent Reply Forwarding", "Automated FAQ Answers", "Customer Feedback Rating") ) ) val subscriptionPlans = listOf( SubscriptionPlan( id = "free", name = "Free Tier", priceFormatted = "INR 0", period = "Free Forever", botLimitText = "1 Active Bot", userLimitText = "Up to 500 Bot Users", features = listOf( "1 Telegram Bot connection", "Max 500 bot users", "Welcome greeting message", "Single-channel force join", "Standard broadcasts", "Event activity logs" ), isCurrent = true, isPopular = false ), SubscriptionPlan( id = "pro", name = "Pro Creator", priceFormatted = "INR 499", period = "per month", botLimitText = "5 Active Bots", userLimitText = "Up to 10,000 Bot Users", features = listOf( "Up to 5 Telegram Bots", "Up to 10,000 bot users", "All Pro Modules unlocked", "AI Smart Auto-Responder", "Multi-channel force join (5 channels)", "UPI and payment gateway", "Vouchers and redeem codes", "High-speed server delivery" ), isCurrent = false, isPopular = true ), SubscriptionPlan( id = "business", name = "Business Agency", priceFormatted = "INR 1,499", period = "per month", botLimitText = "Unlimited Bots", userLimitText = "Unlimited Users", features = listOf( "Unlimited Telegram Bots", "Unlimited bot subscribers", "All Ready-to-Use Bot Templates", "Priority 24/7 dedicated instance", "Custom domain integration", "Full analytics and CSV export", "Direct developer support" ), isCurrent = false, isPopular = false ) ) }