feat(channels): add Slack channel integration with Socket Mode#34
Conversation
Add Slack as a messaging channel using Socket Mode (WebSocket), bringing the total supported channels to 8. Features include bidirectional messaging, thread support with per-thread session context, @mention handling, ack reactions (:eyes:/:white_check_mark:), slash commands, file/attachment support with Groq Whisper audio transcription, and allowlist filtering by Slack user ID. Closes sipeed#31 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…with-socket-mode-threads-reactions-and-slash-commands
|
Great work on adding Slack support! The code is well-structured and the tests look good. I found two issues that should be fixed (these also exist in discord.go - would be great to fix both in one go):
Location: pkg/channels/slack.go:346 http.DefaultClient has no timeout, so the request can hang indefinitely on network issues. Fix:
Location: pkg/channels/slack.go:286 Using context.Background() creates a new context tree that won't be cancelled when the app shuts down. Since SlackChannel already has c.ctx from Fix: I'll be sending a follow-up fix PR today to address these. Just documenting here for visibility! |
|
Thanks for your contribution! We are forming the PicoClaw Dev Group to accelerate the evolution of the project. Any developer with more than one merged PR is invited to join. Would you like to join the PicoClaw Dev Group? If so, please send an email to |
…hannel-integration-with-socket-mode-threads-reactions-and-slash-commands feat(channels): add Slack channel integration with Socket Mode
Summary
/picoclawslash commandsFiles Changed
pkg/channels/slack.go— Full Slack channel implementation (Socket Mode, events, threads, reactions, files)pkg/channels/slack_test.go— Unit tests for ChatID parsing, bot mention stripping, constructor validation, allowlistpkg/config/config.go— AddSlackConfigstruct withbot_token,app_token,allow_frompkg/channels/manager.go— Register Slack channel ininitChannels()cmd/picoclaw/main.go— Wire Groq transcriber to Slack channelconfig.example.json— Add Slack config sectiongo.mod/go.sum— Addgithub.com/slack-go/slackv0.17.3 dependencyConfiguration
{ "channels": { "slack": { "enabled": true, "bot_token": "xoxb-...", "app_token": "xapp-...", "allow_from": [] } } }Slack App Setup
xapp-...)chat:write,channels:history,groups:history,im:history,mpim:history,reactions:read,reactions:write,files:read,commands,app_mentions:readmessage.channels,message.groups,message.im,message.mpim,app_mention,reaction_added,reaction_removed/picoclawxoxb-...)Test plan
go build ./...compiles cleanlygo test ./...all tests passgo vet ./...no issuesCloses #31
🤖 Generated with Claude Code