def _upload_temp_file(self, f, file_reference, truncated_content: bytes, filename: str) -> Optional[str]:
        """Helper to upload a file-like or file path to Slack."""
        f.write(truncated_content)
        f.flush()
        f.seek(0)

        result = self.slack_client.files_upload_v2(
            title=filename,
            file_uploads=[{"file": file_reference, "filename": filename, "title": filename}],
        )
        return result["file"]["permalink"]
Helper to upload a file-like or file path to Slack.
src/robusta/integrations/slack/sender.py