-
-
Save KyMidd/8cff795dcc67efd3460efeaa3a53c111 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Update slack response - handle initial post and streaming response | |
| def update_slack_response(say, client, message_ts, channel_id, thread_ts, message_text): | |
| # If message_ts is None, we're posting a new message | |
| if message_ts is None: | |
| slack_response = say( | |
| text=message_text, | |
| thread_ts=thread_ts, | |
| ) | |
| # Set message_ts | |
| message_ts = slack_response['ts'] | |
| else: | |
| # We're updating an existing message | |
| client.chat_update( | |
| text=message_text, | |
| channel=channel_id, | |
| ts=message_ts, | |
| ) | |
| # Return the message_ts | |
| return message_ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment