@@ -86,12 +86,6 @@ def list_conversation_messages(client: WebClient, conversation_id: str, **kwargs
8686 )
8787
8888
89- @functools .lru_cache ()
90- def get_domain (client : WebClient ) -> str :
91- """Gets the team's Slack domain."""
92- return make_call (client , SlackAPIGetEndpoints .team_info )["team" ]["domain" ]
93-
94-
9589@functools .lru_cache ()
9690def get_user_info_by_id (client : WebClient , user_id : str ) -> dict :
9791 """Gets profile information about a user by id."""
@@ -194,7 +188,7 @@ def create_conversation(client: WebClient, name: str, is_private: bool = False)
194188 return {
195189 "id" : response ["id" ],
196190 "name" : response ["name" ],
197- "weblink" : f"https://{ get_domain ( client ) } . slack.com/app_redirect?channel={ response ['id' ]} " ,
191+ "weblink" : f"https://slack.com/app_redirect?channel={ response ['id' ]} " ,
198192 }
199193
200194
@@ -269,15 +263,6 @@ def add_users_to_conversation(
269263 pass
270264
271265
272- def get_message_permalink (client : WebClient , conversation_id : str , ts : str ) -> str :
273- return make_call (
274- client ,
275- SlackAPIGetEndpoints .chat_permalink ,
276- channel = conversation_id ,
277- message_ts = ts ,
278- )
279-
280-
281266def send_message (
282267 client : WebClient ,
283268 conversation_id : str ,
@@ -302,7 +287,7 @@ def send_message(
302287 return {
303288 "id" : response ["channel" ],
304289 "timestamp" : response ["ts" ],
305- "weblink" : get_message_permalink ( client , response [ " channel" ], response ["ts" ]),
290+ "weblink" : f"https://slack.com/app_redirect? channel= { response ['id' ] } " , # TODO should we fetch the permalink?
306291 }
307292
308293
@@ -326,7 +311,7 @@ def update_message(
326311 return {
327312 "id" : response ["channel" ],
328313 "timestamp" : response ["ts" ],
329- "weblink" : get_message_permalink ( client , response [ " channel" ], response ["ts" ]),
314+ "weblink" : f"https://slack.com/app_redirect? channel= { response ['id' ] } " , # TODO should we fetch the permalink?
330315 }
331316
332317
0 commit comments