@@ -41,10 +41,16 @@ class SlackWebMessageContext(BaseModel):
4141class SlackWebMessagingIntegration (
4242 BaseMessagingIntegration [Channel , SlackWebMessageContext ]
4343):
44- def __init__ (self , client : WebClient , tracking : Optional [Tracking ] = None ) -> None :
44+ def __init__ (
45+ self ,
46+ client : WebClient ,
47+ tracking : Optional [Tracking ] = None ,
48+ reply_broadcast : bool = False ,
49+ ) -> None :
4550 self .client = client
4651 self .tracking = tracking
4752 self ._email_to_user_id_cache : Dict [str , str ] = {}
53+ self .reply_broadcast = reply_broadcast
4854
4955 @classmethod
5056 def from_token (
@@ -77,7 +83,10 @@ def reply_to_message(
7783 ) -> MessageSendResult [SlackWebMessageContext ]:
7884 formatted_message = format_block_kit (body , self .get_user_id_from_email )
7985 return self ._send_message (
80- destination , formatted_message , thread_ts = message_context .id
86+ destination ,
87+ formatted_message ,
88+ thread_ts = message_context .id ,
89+ reply_broadcast = self .reply_broadcast ,
8190 )
8291
8392 @sleep_and_retry
@@ -87,13 +96,15 @@ def _send_message(
8796 destination : Channel ,
8897 formatted_message : FormattedBlockKitMessage ,
8998 thread_ts : Optional [str ] = None ,
99+ reply_broadcast : bool = False ,
90100 ) -> MessageSendResult [SlackWebMessageContext ]:
91101 try :
92102 response = self .client .chat_postMessage (
93103 channel = destination ,
94104 blocks = json .dumps (formatted_message .blocks ),
95105 attachments = json .dumps (formatted_message .attachments ),
96106 thread_ts = thread_ts ,
107+ reply_broadcast = reply_broadcast ,
97108 )
98109 except SlackApiError as e :
99110 self ._handle_send_err (e , destination )
0 commit comments