PoshBot icon indicating copy to clipboard operation
PoshBot copied to clipboard

PSSlack threaded responses

Open joshcorr opened this issue 3 years ago • 3 comments

This PR is looking to add support for the feature requested in #228 for threaded responses from Poshbot with a slack backend.

Description

The quick work around is that there is a check inside the SendMessage function that $Response.OriginalMessage.RawMessage.thread_ts is present. This is ran inside the Slack Backend, but could probably be put into the Response class. This change will require that this change from PSSlack be merged. https://github.com/RamblingCookieMonster/PSSlack/pull/119

Related Issue

#228

Motivation and Context

I was personally looking for a way to keep PoshBot messages threaded and didn't find any documentation for current support. I noticed the open issue, and thought it would be fun. This can help users cut down on noise in a channel without loosing the transparency of working with a bot.

How Has This Been Tested?

Setup a Test bot on a personal slack channel and tested threaded/Non threaded built-in, Giphy and XKCD plugin. Also tested in DMs as well. Tested various response types to ensure that text/card/url/file all respond as expected. Still having an issue with threaded file uploads.

Screenshots (if appropriate):

Previous non working state: Any message to a thread is returned to the channel. before

working state: Keyword in thread is returned to thread. Keyword in Channel is returned to channel. Keyword in DM is only sent to DM after

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ ] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

joshcorr avatar Jun 26 '21 05:06 joshcorr

Did some more testing and was able to get the threading to work with files. I am now able to get all response types to thread.

filetest

joshcorr avatar Jun 27 '21 04:06 joshcorr

@devblackops Believe that this is ready to review and merge when you are ready.

joshcorr avatar Jul 01 '21 10:07 joshcorr

The Pipeline states that it is failing, but all of the pester tests are passing.

joshcorr avatar Jul 16 '21 01:07 joshcorr