Simplify thread reaction and add thread_please for broadcast enforcement#12
Conversation
Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com>
Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com>
|
@copilot so I did some investigation and turns out that there is no programmatic way to remove message from the channel without removing it from the threads. So what we will do is let's roll back functionality to I told what it was before a few if you commit before a few pull requests before so when I when we removed when we had two types for threat so when it was just one. Yeah let's keep that. So we should have no logic for dealing with two types for a message. So that's one thing. Another thing iscreate a new handler for thread_please which deletes the message and sends topic starter is. Please don't use the reply to channel functionality. This is against the community good guidelines. Send the links to the guidelines and say that feel free to repost this message again without using the broadcast functionality |
Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com>
Done! I've made the following changes in commit 8e87dd9:
All 22 tests pass and no security issues found. |
Based on investigation, Slack's API does not allow programmatically removing messages from the channel without also removing them from threads. This PR simplifies the approach and adds a dedicated reaction for handling broadcasted messages.
Changes
automator/lambda_function.py
handle_slack_post()automator/config.yaml
types: [REMOVE_BROADCAST, SLACK_POST]) to single handler (type: SLACK_POST)type: DELETE_MESSAGEthat:tests/test_automator_lambda.py
TestMultipleHandlersto verify single handler executionBehavior
"thread" reaction
Simply posts a reminder message to use threads (no broadcast handling)
"thread_please" reaction (NEW)
When triggered on a broadcasted message:
Testing
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.