Skip to content

Comments

feat(slack): add slash command support#25

Closed
hrygo wants to merge 11 commits intomainfrom
feat/slack-slash-commands
Closed

feat(slack): add slash command support#25
hrygo wants to merge 11 commits intomainfrom
feat/slack-slash-commands

Conversation

@hrygo
Copy link
Owner

@hrygo hrygo commented Feb 24, 2026

Summary

Add slash command support to Slack adapter, enabling users to trigger actions via Slack commands like /avatar.

Changes

  • Add SlashCommand type with Command, Text, UserID, ChannelID, ResponseURL fields
  • Add slash command handler at /slack endpoint
  • Add SetSlashCommandHandler for custom command processing

Context

Slash commands are a common interaction pattern in Slack, enabling users to trigger actions via text commands. This addresses the "Slash Commands" gap identified in the comparison report.

Testing

  • Test slash command registration in Slack
  • Test command parsing and handling
  • Test command response

Related

黄飞虹 and others added 11 commits February 25, 2026 01:12
…al communication

- Fix Socket Mode payload parsing: use "payload" field instead of "body"
- Add proper Slack API response validation (check "ok" field)
- Fix subtype filtering: allow file_share/bot_message, only skip message_changed/deleted
- Fix nil pointer panic in EngineMessageHandler by checking workDirFn and taskInstrFn
- Preserve original message metadata (channel_id, thread_ts) in StreamCallback for replies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When bot is mentioned in a channel with @botName, Slack sends app_mention
event instead of regular message event. Register both handlers to support
both DMs and channel mentions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Slack bot now uses current working directory (HotPlex source) as workspace
- Other platforms continue using /tmp/hotplex-chatapps for isolation
- Add app_mention handler for @mentions in channels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SendAttachment method for sending files/images to Slack
- Add sendFileFromURL for external URL uploads
- Integrate with defaultSender to handle RichContent attachments
- Support thread replies for attachments
- Add engine.work_dir config option in slack.yaml
- Use "." (current directory) as default for HotPlex development
- Falls back to /tmp/hotplex-chatapps if not configured

This allows the Slack bot to operate on any directory specified in config,
making it easy to use for HotPlex development or other projects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add comprehensive comparison analysis between HotPlex and OpenClaw Slack implementations
- Document 13 feature gaps across 6 categories (P0/P1/P2 priority)
- Include 3-phase implementation roadmap (14-20 weeks estimated)
- Identify technical debt risks in socket_mode.go and retry.go
- Reference: Issue #21
- Add expandPath helper function to expand ~ to absolute paths
- Update slack.yaml with engine.work_dir config option- Falls back to /tmp/hotplex-chatapps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove duplicate s.handleEventsAPI call that caused double message processing
- Implement ACK response for Socket Mode events (required by Slack API)
- Slack expects envelope_id acknowledgment within 3 seconds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Reaction type to base.RichContent
- Add AddReaction method to Slack adapter
- Integrate reactions into defaultSender
- Add SlashCommand type
- Add slash command handler at /slack endpoint
- Add SetSlashCommandHandler for custom processing
@hrygo hrygo closed this Feb 24, 2026
@hrygo hrygo deleted the feat/slack-slash-commands branch February 24, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack 实现与 OpenClaw 对比报告:功能差距分析与建议

1 participant