0

need some help with sending responses to a channel and every subsequent message to a thread. So currently the below code will reply to the thread of the command given in a Slack channel.

responses = command(requested_parameters)
for response in responses:
    app.client.chat_postMessage(
        channel = event["channel"],
        thread_ts=thread_ts,
        attachments=response,
        )

So lets call the channel where the command was given and the above works channel: "A".

What I need is for someone to enter a command in channel "A", but the response(s) to go to channel "B". This is achieved by modifying one of the lines to:

        channel = "console-notifications",

My challenge is that I go through a few loops and each time a response is given a new message that is sent to channel "B". Is there a way to send a response to channel "B", capture the message id of the first response and then send any subsequent message to its thread?

python3.9

slack-bolt==1.15.5

Hopefully the above question is clear and makes sense.

Thanks...

New2Python
  • 325
  • 1
  • 4
  • 17

0 Answers0