feat(slack): ability to have DM channels as destination for slack tools - #2388
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile OverviewGreptile SummaryThis PR adds support for Slack direct messages (DMs) as a destination type alongside channels. The implementation introduces a Key Changes:
Architecture: Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant UI as Slack Block UI
participant Serializer
participant SendAPI as /api/tools/slack/send-message
participant UsersAPI as /api/tools/slack/users
participant Utils as slack/utils.ts
participant Slack as Slack API
Note over User,Slack: DM Channel Selection Flow
User->>UI: Select "Direct Message" destination
UI->>UsersAPI: POST /api/tools/slack/users
UsersAPI->>Slack: GET users.list
Slack-->>UsersAPI: User list
UsersAPI-->>UI: Filtered users (non-bot, non-deleted)
User->>UI: Select user from dropdown
Note over User,Slack: Send DM Flow
User->>UI: Click Send
UI->>Serializer: Serialize block params
Serializer->>Serializer: Evaluate conditions (destinationType=dm)
Serializer->>Serializer: Include dmUserId, exclude channel
Serializer->>SendAPI: POST with userId
SendAPI->>Utils: sendSlackMessage({userId, text})
Utils->>Slack: POST conversations.open
Slack-->>Utils: DM channel ID
Utils->>Slack: POST chat.postMessage
Slack-->>Utils: Message response
Utils-->>SendAPI: Success
SendAPI-->>UI: Message sent
Note over User,Slack: Read DM Flow
User->>SendAPI: Read messages with userId
SendAPI->>Utils: openDMChannel(userId)
Utils->>Slack: POST conversations.open
Slack-->>Utils: DM channel ID
Utils->>Slack: GET conversations.history
Slack-->>Utils: Messages
Utils-->>SendAPI: Messages
SendAPI-->>User: DM messages
|
Collaborator
Author
Merged
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surface DM channels correctly.
Type of Change
Testing
Tested with @aadamgough
Checklist