-
Notifications
You must be signed in to change notification settings - Fork 0
feat(channels): add Discord, WhatsApp, Slack, Signal adapters #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Discord: discord.js with guild/channel config, pairing flow - WhatsApp: Baileys with QR auth, session persistence - Slack: Bolt SDK with socket mode, channel config - Signal: signal-cli daemon with SSE, pairing flow All adapters implement the ChannelAdapter interface with: - Pairing flow for DM security - Group policy support - Message chunking per platform limits Also adds comprehensive documentation in docs/channels/
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis pull request introduces comprehensive channel adapter implementations for Discord, Signal, Slack, and WhatsApp alongside existing Telegram support, along with extensive documentation, configuration schemas, and package exports. The adapters implement a unified ChannelAdapter interface for managing connections, sending/receiving messages, and pairing-based sender approval across different messaging platforms. Changes
Sequence Diagram(s)sequenceDiagram
actor App as Application
participant CA as Channel Adapter<br/>(Discord/Signal/Slack/WhatsApp)
participant Service as External Service<br/>(Platform API/Daemon)
actor User as External User
rect rgba(100, 150, 200, 0.5)
Note over App,Service: Initialization & Connection
App->>CA: initialize(config)
CA->>CA: populate allowlist & config
App->>CA: connect()
CA->>Service: establish connection<br/>(token/daemon/socket)
Service-->>CA: connection established
CA->>App: ready
end
rect rgba(100, 200, 100, 0.5)
Note over App,Service: Outbound Message Flow
App->>CA: send(message)
CA->>CA: validate recipient
CA->>Service: post message<br/>(chunk if needed)
Service-->>CA: messageId, timestamp
CA->>App: SendResult
end
rect rgba(200, 150, 100, 0.5)
Note over CA,User: Inbound Message Flow
User->>Service: send message
Service-->>CA: event/webhook/stream
CA->>CA: parse & construct<br/>InboundMessage
CA->>CA: validate sender<br/>(allowlist/policy)
CA->>App: dispatch to handlers
App-->>CA: handler response
CA->>Service: send reply/ACK
end
rect rgba(200, 100, 150, 0.5)
Note over CA,User: Pairing Flow (First-Time)
User->>CA: request pairing<br/>(message to bot)
CA->>CA: generate code<br/>(expires 1hr)
CA->>User: send pairing code
User->>App: admin approves code
App->>CA: approvePairing(code)
CA->>CA: add sender to allowlist
CA-->>User: pairing confirmed
end
rect rgba(150, 100, 200, 0.5)
Note over App,Service: Cleanup
App->>CA: disconnect()
CA->>Service: close connection
CA->>App: disconnected
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes The review complexity is driven by four substantial, heterogeneous adapter implementations (~1,500 lines) across different platforms (Discord.js, signal-cli, Slack Bolt, Baileys) with diverse patterns (daemon spawning, SSE streaming, socket mode, dynamic imports). Each adapter requires separate reasoning for event handling, security (pairing, allowlist enforcement), attachment mapping, policy application, and error handling. Supporting documentation, configuration schemas, and package-level changes add additional breadth. The similar structure across adapters provides some consistency but does not reduce the need to verify each platform-specific implementation and its integration points. Poem
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code ReviewI found 3 instances where
Issues Found:
All three instances have ESLint disable comments, indicating awareness of the violation. Using proper types or |
Summary
All adapters implement:
Test plan
Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Updates
✏️ Tip: You can customize this high-level summary in your review settings.