Enable file uploads inside threads #188
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for uploading files into a Slack thread by extending the Client::filesUploadV2() helper to accept an optional thread_ts, and wires this through in the integration test configuration.
Changes:
- Extend
Client::filesUploadV2()with an optional$threadTsparameter and pass it asthread_tstofilesCompleteUploadExternal. - Update the existing external upload integration test to pass a thread timestamp.
- Document new Slack test env var(s) in
phpunit.xml.dist.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Client.php |
Adds optional thread_ts support to filesUploadV2() and updates its docblock. |
tests/WritingTest.php |
Uses SLACK_TEST_THREAD_TS and passes it to filesUploadV2() for thread uploads. |
phpunit.xml.dist |
Documents SLACK_TEST_THREAD_TS and clarifies SLACK_TEST_CHANNEL expectations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Thanks for this contribution, looks good. Copilot made some good suggestion as well. Looking futher into this subject, it appear that more than one parameter is missing. The official Python implementation has a lot: Whould you have the ressources and time to propose something or should we open a new issue and just to the thread thing now? |
The suggestions of copilot are good indeed, will incorporate. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
Thanks a lot for pushing your changes upstream 🙏 |
|
Version v4.9.0 has been released with your change, thanks again 👍 |
This PR will allow file uploads inside threads, useful when you have a bot in a thread returning a file.
see slack documentation: https://docs.slack.dev/reference/methods/files.completeUploadExternal/#:~:text=Example%3A%20C0NF841BK-,thread_ts,-string
Tested on a dev slack app