Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce output file containing response from Slack API #98

Open
fenech opened this issue Sep 22, 2023 · 1 comment
Open

Produce output file containing response from Slack API #98

fenech opened this issue Sep 22, 2023 · 1 comment

Comments

@fenech
Copy link
Contributor

fenech commented Sep 22, 2023

Hi, I'm using this resource to print messages to a Slack channel, but the messages can be very long, and I'd like to be able to post a summary as a main message, followed by the longer details in a reply thread.

To do that, I would need the ts in the response from Slack, and include it as the thread_ts parameter in the follow-up message.

I can think of a few ways to do this:

  1. roll everything into one put step, with extra parameters to specify the thread contents
  2. use a put step to post the first message, then a custom task to post the remainder
  3. use two consecutive puts, and add a parameter to specify the thread_ts

I think that #1 could introduce quite a lot of extra complexity in the resource, so I think #2 or #3 would be the preferred approach. However, in order to do that, the put step would need to produce some output that could be used in subsequent steps.

At the moment the resource outputs a timestamp which is the output of date, but perhaps this timestamp could instead be the ts from the result (if available)? Then the implicit get step after the put could be used to write some output files for use in later steps.

Happy to try and make a PR with some changes if we agree on an approach 😄

@fenech
Copy link
Contributor Author

fenech commented Sep 28, 2023

I was confusing the chat.postMessage API with the webhooks API used by this resource. The latter only returns an HTTP 200 with body "ok" so none of the information I was hoping to use is available. So I guess that this would be a much bigger rewrite than I thought.

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

No branches or pull requests

1 participant