Metadata-Version: 2.4
Name: discord-ops-alert
Version: 0.1.0
Summary: Python SDK for sending Discord notifications — fire-and-forget, retry, webhook/bot mode
Project-URL: Homepage, https://github.com/luca-ops/discord-ops-alert-py
Project-URL: Repository, https://github.com/luca-ops/discord-ops-alert-py
License: MIT
Keywords: alerts,bot,discord,notifications,webhook
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: python-dotenv>=1.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# discord-ops-alert (Python)

Python SDK for sending Discord notifications — fire-and-forget, retry, webhook/bot mode.

Mirror of the TypeScript [`discord-ops-alert`](https://www.npmjs.com/package/discord-ops-alert) npm package.

## Install

```bash
pip install discord-ops-alert
# or
uv add discord-ops-alert
```

## Usage

```python
from discord_ops_alert import create_notifier

# Webhook mode
notify = create_notifier(
    mode="webhook",
    webhooks={"login": "https://discord.com/api/webhooks/ID/TOKEN"},
    enabled_in=["production"],
)
notify(topic="login", message="User logged in")  # fire-and-forget

# Bot mode
import os, json
notify = create_notifier(
    mode="bot",
    token=os.environ["DISCORD_BOT_TOKEN"],
    channels=json.loads(os.environ["CHANNEL_MAP_JSON"]),
    enabled_in=["production"],
)

# Async variant
result = await notify.async_(topic="login", message="User logged in")
```
