@@ -435,9 +435,9 @@ async def _download_slack_file(self, file_info: dict[str, Any]) -> tuple[str | N
435435 marker = f"[{ marker_type } : { name } ]"
436436 url = str (file_info .get ("url_private_download" ) or file_info .get ("url_private" ) or "" )
437437 if not url :
438- return None , f"[ { marker_type } : { name } : missing download url]"
438+ return None , self . _download_failure_marker ( marker_type , name , " missing download url" )
439439 if not self .config .bot_token :
440- return None , f"[ { marker_type } : { name } : missing bot token]"
440+ return None , self . _download_failure_marker ( marker_type , name , " missing bot token" )
441441
442442 filename = safe_filename (f"{ file_id } _{ name } " )
443443 path = Path (get_media_dir ("slack" )) / filename
@@ -454,7 +454,14 @@ async def _download_slack_file(self, file_info: dict[str, Any]) -> tuple[str | N
454454 return str (path ), marker
455455 except Exception as e :
456456 logger .warning ("Failed to download Slack file {}: {}" , file_id , e )
457- return None , f"[{ marker_type } : { name } : download failed]"
457+ return None , self ._download_failure_marker (marker_type , name , "download failed" )
458+
459+ @staticmethod
460+ def _download_failure_marker (marker_type : str , name : str , reason : str ) -> str :
461+ return (
462+ f"[{ marker_type } : { name } : { reason } ; not available to nanobot. "
463+ "Check Slack files:read scope, reinstall the Slack app, and ensure the bot can access the file.]"
464+ )
458465
459466 @staticmethod
460467 def _looks_like_html_download (response : httpx .Response ) -> bool :
0 commit comments