Fix flat replies in DMs
DM replies were threaded under Adam's message instead of appearing flat. Root cause: listener fell back to event["ts"] as thread_ts for new DMs, causing say() to post as a threaded reply. Removed the fallback so DMs always use flat messages with placeholder update. Closes #4
This commit is contained in:
parent
5646080981
commit
36bd41e238
1 changed files with 2 additions and 2 deletions
|
|
@ -64,7 +64,7 @@ def _get_coordination(channel, thread_ts):
|
||||||
def _dispatch_conversation(text, thread_ts, channel, say, is_dm):
|
def _dispatch_conversation(text, thread_ts, channel, say, is_dm):
|
||||||
placeholder_ts = None
|
placeholder_ts = None
|
||||||
if is_dm:
|
if is_dm:
|
||||||
result = say(text="Thinking...", thread_ts=thread_ts)
|
result = say(text="Thinking...")
|
||||||
placeholder_ts = result["ts"]
|
placeholder_ts = result["ts"]
|
||||||
|
|
||||||
lambda_client.invoke(
|
lambda_client.invoke(
|
||||||
|
|
@ -143,7 +143,7 @@ def handle_message(event, say):
|
||||||
if not text:
|
if not text:
|
||||||
return
|
return
|
||||||
|
|
||||||
thread_ts = event.get("thread_ts") or event["ts"]
|
thread_ts = None
|
||||||
_dispatch_conversation(text, thread_ts, event["channel"], say, is_dm=True)
|
_dispatch_conversation(text, thread_ts, event["channel"], say, is_dm=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue