Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

How to add a thread message if using slacker #158

Open
as3379 opened this issue Oct 11, 2019 · 1 comment
Open

How to add a thread message if using slacker #158

as3379 opened this issue Oct 11, 2019 · 1 comment

Comments

@as3379
Copy link

as3379 commented Oct 11, 2019

How to find ts_id from a given response. I'm trying to send a message to slack and add a thread to original message. To do so I need the ts_id of the original message. The code looks like:

response = client.chat.post_message(channel=channel, text=message)
ts = response['ts']
text = 'Copy into https://codebeautify.org/jsonviewer.'
client.chat.post_message(
channel=channel,
thread_ts=ts,
text=text
)

However, code fails to retrieve the ts value from response.

@GregHilston
Copy link

@as3379 I know this is a very late reply, but I tested out sending a message in a public channel and got this reply:

{'client_msg_id': '6ed12f32-c9fa-4c6f-9bb5-9c5993a78bfa', 'suppress_notification': False, 'type': 'message', 'text': 'test', 'user': 'U389XUHT2', 'team': 'T38AP97Q9', 'blocks': [{'type': 'rich_text', 'block_id': 'N4y3', 'elements': [{'type': 'rich_text_section', 'elements': [{'type': 'text', 'text': 'test'}]}]}], 'source_team': 'T38AP97Q9', 'user_team': 'T38AP97Q9', 'channel': 'C3FAX3UCV', 'event_ts': '1591450995.006800', 'ts': '1591450995.006800'}

Which has your ts as expected

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants