Sends formatted Slack notifications via incoming webhook for event alerts.
# Source: https://github.com/greyhaven-ai/autocontext | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Slack incoming webhook notifier."""
from __future__ import annotations
import json
import logging
import urllib.error
import urllib.request
from autocontext.notifications.base import EventType, NotificationEvent, Notifier
from autocontext.offline import require_online
logger = logging.getLogger(__name__)
class SlackWebhookNotifier(Notifier):
"""Sends notifications to a Slack incoming webhook.
Formats events as Slack-friendly messages with emoji and structure.
"""
def __init__(self, webhook_url: str, channel: str | None = None, timeout: float = 10.0) -> No
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key