Python SDK for sending Discord notifications — fire-and-forget, retry, webhook/bot mode
Project description
discord-ops-alert (Python)
Python SDK for sending Discord notifications — fire-and-forget, retry, webhook/bot mode.
Mirror of the TypeScript discord-ops-alert npm package.
Install
pip install discord-ops-alert
# or
uv add discord-ops-alert
Usage
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
discord_ops_alert-0.1.0.tar.gz
(43.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file discord_ops_alert-0.1.0.tar.gz.
File metadata
- Download URL: discord_ops_alert-0.1.0.tar.gz
- Upload date:
- Size: 43.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cd89810de4f4283ef3a0dbc0080886c40fe5cf0b00717e8e627f499d9bde45b
|
|
| MD5 |
6e7a1754ba4c9a70d0d6109715a08b1b
|
|
| BLAKE2b-256 |
e07baee3d7929d04b1c96d35667ea2db4dd2aa83d20599edef920ffe2f268151
|
File details
Details for the file discord_ops_alert-0.1.0-py3-none-any.whl.
File metadata
- Download URL: discord_ops_alert-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8388f30f9df9921ac2d5138b78a4b957de612311c1066b29a706ab439d6cd8ba
|
|
| MD5 |
d6517a598e096f2781cc7712bb93c95f
|
|
| BLAKE2b-256 |
b28482b8acdde38e0ee2672b9a4ce702cc574a2de4ec6154cec4fd6f9990af56
|