File tree Expand file tree Collapse file tree 4 files changed +8
-16
lines changed
slack_bolt/context/get_thread_context Expand file tree Collapse file tree 4 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,10 @@ async def __call__(self) -> Optional[AssistantThreadContext]:
3131 if self .thread_context_loaded is True :
3232 return self ._thread_context
3333
34- if self .payload .get ("assistant_thread" ) is not None :
34+ thread = self .payload .get ("assistant_thread" )
35+ if thread is not None and thread .get ("context" , {}).get ("channel_id" ) is not None :
3536 # assistant_thread_started
36- thread = self .payload ["assistant_thread" ]
37- self ._thread_context = (
38- AssistantThreadContext (thread ["context" ])
39- if thread .get ("context" , {}).get ("channel_id" ) is not None
40- else None
41- )
37+ self ._thread_context = AssistantThreadContext (thread ["context" ])
4238 # for this event, the context will never be changed
4339 self .thread_context_loaded = True
4440 elif self .payload .get ("channel" ) is not None and self .payload .get ("thread_ts" ) is not None :
Original file line number Diff line number Diff line change @@ -31,14 +31,10 @@ def __call__(self) -> Optional[AssistantThreadContext]:
3131 if self .thread_context_loaded is True :
3232 return self ._thread_context
3333
34- if self .payload .get ("assistant_thread" ) is not None :
34+ thread = self .payload .get ("assistant_thread" )
35+ if thread is not None and thread .get ("context" , {}).get ("channel_id" ) is not None :
3536 # assistant_thread_started
36- thread = self .payload ["assistant_thread" ]
37- self ._thread_context = (
38- AssistantThreadContext (thread ["context" ])
39- if thread .get ("context" , {}).get ("channel_id" ) is not None
40- else None
41- )
37+ self ._thread_context = AssistantThreadContext (thread ["context" ])
4238 # for this event, the context will never be changed
4339 self .thread_context_loaded = True
4440 elif self .payload .get ("channel" ) is not None and self .payload .get ("thread_ts" ) is not None :
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ def build_payload(event: dict) -> dict:
186186 "channel" : "D111" ,
187187 "event_ts" : "1726133700.887259" ,
188188 "channel_type" : "im" ,
189- "assistant_thread" : {"XXX " : "YYY " },
189+ "assistant_thread" : {"action_token " : "10647138185092.960436384805.afce3599 " },
190190 }
191191)
192192
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ def build_payload(event: dict) -> dict:
200200 "channel" : "D111" ,
201201 "event_ts" : "1726133700.887259" ,
202202 "channel_type" : "im" ,
203- "assistant_thread" : {"XXX " : "YYY " },
203+ "assistant_thread" : {"action_token " : "10647138185092.960436384805.afce3599 " },
204204 }
205205)
206206
You can’t perform that action at this time.
0 commit comments