{"record":{"id":"9bfa62e7a3c3cc6a","repo":"sansan0/TrendRadar","slug":"split-content-func-is-required","errorCode":null,"errorMessage":"split_content_func is required","messagePattern":"split_content_func is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"trendradar/notification/senders.py","lineNumber":1247,"sourceCode":"        webhook_url: Webhook URL\n        payload_template: JSON 模板字符串，支持 {title} 和 {content} 占位符\n        report_data: 报告数据\n        report_type: 报告类型\n        update_info: 更新信息（可选）\n        proxy_url: 代理 URL（可选）\n        mode: 报告模式 (daily/current)\n        account_label: 账号标签（多账号时显示）\n        batch_size: 批次大小（字节）\n        batch_interval: 批次发送间隔（秒）\n        split_content_func: 内容分批函数\n        rss_items: RSS 统计条目列表（可选，用于合并推送）\n        rss_new_items: RSS 新增条目列表（可选，用于新增区块）\n\n    Returns:\n        bool: 发送是否成功\n    \"\"\"\n    if split_content_func is None:\n        raise ValueError(\"split_content_func is required\")\n\n    headers = {\"Content-Type\": \"application/json\"}\n    proxies = None\n    if proxy_url:\n        proxies = {\"http\": proxy_url, \"https\": proxy_url}\n\n    # 日志前缀\n    log_prefix = f\"通用Webhook{account_label}\" if account_label else \"通用Webhook\"\n\n    # 渲染 AI 分析内容并提取统计数据（通用 Webhook 使用 markdown 格式）\n    ai_content = _render_ai_analysis(ai_analysis, \"wework\") if ai_analysis else None\n    ai_stats = _extract_ai_stats(ai_analysis)\n\n    # 获取分批内容\n    # 使用 'wework' 作为 format_type 以获取 markdown 格式的通用输出\n    # 预留一定空间给模板外壳\n    template_overhead = 200\n    batches = split_content_func(","sourceCodeStart":1229,"sourceCodeEnd":1265,"githubUrl":"https://github.com/sansan0/TrendRadar/blob/8ee26026ba6c11dec41a95fb3895a7162876caa1/trendradar/notification/senders.py#L1229-L1265","documentation":"Error \"split_content_func is required\" thrown in sansan0/TrendRadar.","triggerScenarios":"Thrown at trendradar/notification/senders.py:1247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["调用通用 Webhook 发送函数时传入 split_content_func 参数（内容分段函数）","检查调用点，确保未遗漏必需参数"],"exampleFix":"send_to_webhook(..., split_content_func=split_content)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8ee26026ba6c11dec41a95fb3895a7162876caa1","analyzedAt":"2026-08-15T01:42:18.084Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}