Skip to content

Commit

Permalink
fix: bug where parsing assistant thread message event fails for beta …
Browse files Browse the repository at this point in the history
…feature enabled apps (#2298)
  • Loading branch information
seratch authored Oct 22, 2024
1 parent 840a26b commit a382238
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ export function extractThreadInfo(payload: AllAssistantMiddlewareArgs['payload']
let context: AssistantThreadContext = {};

// assistant_thread_started, asssistant_thread_context_changed
if ('assistant_thread' in payload) {
if (
'assistant_thread' in payload &&
'channel_id' in payload.assistant_thread &&
'thread_ts' in payload.assistant_thread
) {
channelId = payload.assistant_thread.channel_id;
threadTs = payload.assistant_thread.thread_ts;
context = payload.assistant_thread.context;
Expand Down

0 comments on commit a382238

Please sign in to comment.