Update bot and webserver integration for healing system support

- Enhance bot initialization to support healing system background tasks
- Update webserver to properly handle healing system web interfaces
- Ensure proper integration between IRC bot and web components
- Add support for healing system status monitoring and display
- Maintain unified user experience across IRC and web interfaces

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
megaproxy 2025-07-16 11:33:37 +00:00
parent 8ae7da8379
commit 530134bd36
2 changed files with 856 additions and 35 deletions

View file

@ -19,7 +19,8 @@ from src.database import Database
from src.game_engine import GameEngine
from src.irc_connection_manager import IRCConnectionManager, ConnectionState
from src.rate_limiter import RateLimiter, get_command_category
from modules import CoreCommands, Exploration, BattleSystem, PetManagement, Achievements, Admin, Inventory, GymBattles, TeamBuilder
from src.npc_events import NPCEventsManager
from modules import CoreCommands, Exploration, BattleSystem, PetManagement, Achievements, Admin, Inventory, GymBattles, TeamBuilder, NPCEventsModule
from webserver import PetBotWebServer
from config import IRC_CONFIG, RATE_LIMIT_CONFIG
@ -42,6 +43,7 @@ class PetBotWithReconnect:
# Core components
self.database = Database()
self.game_engine = GameEngine(self.database)
self.npc_events = None
self.config = IRC_CONFIG
# Connection and state management
@ -82,6 +84,11 @@ class PetBotWithReconnect:
await self.game_engine.load_game_data()
self.logger.info("✅ Game data loaded")
# Initialize NPC events manager
self.logger.info("🔄 Initializing NPC events manager...")
self.npc_events = NPCEventsManager(self.database)
self.logger.info("✅ NPC events manager initialized")
# Load modules
self.logger.info("🔄 Loading command modules...")
await self.load_modules()
@ -118,6 +125,7 @@ class PetBotWithReconnect:
self.logger.info("🔄 Starting background tasks...")
asyncio.create_task(self.background_validation_task())
asyncio.create_task(self.connection_stats_task())
asyncio.create_task(self.npc_events.start_background_task())
self.logger.info("✅ Background tasks started")
self.logger.info("🎉 All components initialized successfully!")
@ -137,7 +145,8 @@ class PetBotWithReconnect:
Admin,
Inventory,
GymBattles,
TeamBuilder
TeamBuilder,
NPCEventsModule
]
self.modules = {}