story-kit: merge 320_story_whatsapp_business_api_integration_for_bot_commands

This commit is contained in:
Dave
2026-03-19 23:03:35 +00:00
parent cc0110e577
commit 351f770516
8 changed files with 721 additions and 90 deletions
+6 -3
View File
@@ -368,8 +368,11 @@ pub async fn run_bot(
// Create the transport abstraction based on the configured transport type.
let transport: Arc<dyn ChatTransport> = match config.transport.as_str() {
"whatsapp" => {
slog!("[matrix-bot] Using WhatsApp transport (stub)");
Arc::new(crate::whatsapp::WhatsAppTransport::new())
slog!("[matrix-bot] Using WhatsApp transport");
Arc::new(crate::whatsapp::WhatsAppTransport::new(
config.whatsapp_phone_number_id.clone().unwrap_or_default(),
config.whatsapp_access_token.clone().unwrap_or_default(),
))
}
_ => {
slog!("[matrix-bot] Using Matrix transport");
@@ -1393,7 +1396,7 @@ mod tests {
ambient_rooms: Arc::new(std::sync::Mutex::new(HashSet::new())),
agents: Arc::new(AgentPool::new_test(3000)),
htop_sessions: Arc::new(TokioMutex::new(HashMap::new())),
transport: Arc::new(crate::whatsapp::WhatsAppTransport::new()),
transport: Arc::new(crate::whatsapp::WhatsAppTransport::new("test-phone".to_string(), "test-token".to_string())),
};
// Clone must work (required by Matrix SDK event handler injection).
let _cloned = ctx.clone();