use crate::chat_channels::ChatChannel; use crate::chat_service::Clients; use crate::chat_service::chat::ChatMessage; /// A dedicated module for guild chat. #[derive(Debug)] pub struct GuildChat; impl ChatChannel for GuildChat { fn handle_message(&self, message: ChatMessage, sender_id: &str, clients: &Clients) { // This is a placeholder. In a real implementation, verify // guild membership by consulting your Character or Guild service. let clients_lock = clients.lock().unwrap(); for (id, tx) in clients_lock.iter() { // For demonstration, send only to clients whose IDs contain // "guild". Replace this logic with your actual membership check. if id != sender_id && id.contains("guild") { let _ = tx.try_send(message.clone()); } } } }