#!/usr/bin/env python3 """Team builder module for PetBot - handles PIN delivery and verification""" from .base_module import BaseModule class TeamBuilder(BaseModule): """Handles team builder PIN system and IRC integration""" def get_commands(self): return [] # No direct IRC commands, only web interface async def handle_command(self, channel, nickname, command, args): # No direct commands handled by this module pass async def send_team_builder_pin(self, nickname, pin_code, team_name=None): """Send PIN to player via private message""" team_text = f" for {team_name}" if team_name else "" message = f"""๐Ÿ” Team Builder Verification PIN{team_text}: {pin_code} This PIN will expire in 10 minutes. Enter this PIN on the team builder web page to confirm your team changes. โš ๏ธ Keep this PIN private! Do not share it with anyone.""" self.send_pm(nickname, message) self.logger.info(f"๐Ÿ” Sent team builder PIN to {nickname}: {pin_code}{team_text}") async def cleanup_expired_data(self): """Clean up expired PINs and pending requests""" try: result = await self.database.cleanup_expired_pins() if result["success"] and (result["pins_cleaned"] > 0 or result["changes_cleaned"] > 0): self.logger.info(f"๐Ÿงน Cleaned up {result['pins_cleaned']} expired PINs and {result['changes_cleaned']} pending changes") except Exception as e: self.logger.error(f"Error during cleanup: {e}")