(message: str, webhook_url: Optional[str] = None)
| 16 | |
| 17 | |
| 18 | async def send_slack(message: str, webhook_url: Optional[str] = None) -> bool: |
| 19 | url = webhook_url or config.notification.slack_webhook |
| 20 | if not url: |
| 21 | logger.info("Slack webhook not configured – skipping") |
| 22 | return False |
| 23 | async with httpx.AsyncClient() as client: |
| 24 | resp = await client.post(url, json={"text": message}, timeout=10) |
| 25 | return resp.status_code == 200 |
| 26 | |
| 27 | |
| 28 | async def send_dingtalk(message: str, webhook_url: Optional[str] = None) -> bool: |