15 lines
339 B
Python
15 lines
339 B
Python
from dataclasses import dataclass
|
|
|
|
import httpx
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class WebhookNotification:
|
|
url: str
|
|
text: str
|
|
|
|
|
|
async def send_generic_webhook(notification: WebhookNotification) -> None:
|
|
async with httpx.AsyncClient(timeout=10) as client:
|
|
await client.post(notification.url, json={"text": notification.text})
|