Build rich Discord Webhook API interactions with a typed Python API.
Clyde supports plain messages, Components, and rich Embeds for the Discord Webhook API. It validates each payload and sends it through synchronous or asynchronous HTTP methods.
Features
- Type annotations across the public API
- Input type and field validation with msgspec
- Plain content, every webhook-compatible Discord Component, and field-level Embed controls
- Helpers for Discord-flavored Markdown and timestamps
- Synchronous and asynchronous HTTP requests through niquests
- Automatic retries when Discord returns a rate limit
- API documentation generated with Zensical
Installation
[!IMPORTANT] Clyde requires Python 3.11 or later.
Add Clyde to a uv project:
uv add discord-clyde
Examples
Plain Message
from clyde import Webhook
Webhook(
url="https://discord.com/api/webhooks/00000/XXXXXXXXXX",
avatar_url="https://i.imgur.com/RzkhQgZ.png",
username="Heisenberg",
content="[Clyde](https://github.com/EthanC/Clyde) says hi!",
).execute()
Message With Components
from clyde import Webhook
from clyde.components import ActionRow, LinkButton, TextDisplay
webhook = Webhook(
url="https://discord.com/api/webhooks/00000/XXXXXXXXXX",
avatar_url="https://i.imgur.com/BpcKmVO.png",
username="TARS",
)
webhook.add_component(
[
TextDisplay(content="[Clyde](https://github.com/EthanC/Clyde) says hi!"),
ActionRow(
components=[
LinkButton(
label="Try Clyde",
url="https://github.com/EthanC/Clyde",
)
]
),
]
).execute()
Message With an Embed
from clyde import Embed, Webhook
Webhook(
url="https://discord.com/api/webhooks/00000/XXXXXXXXXX",
avatar_url="https://i.imgur.com/QaTHttz.png",
username="Shady",
embeds=[
Embed(
description="[Clyde](https://github.com/EthanC/Clyde) says hi!",
color="#5865F2",
)
],
).execute()
Releases
Clyde loosely follows Semantic Versioning.
Contributing
Bug fixes and new features are welcome. Read the contribution guide before opening a pull request. Known bugs and feature requests are tracked in GitHub Issues.
Acknowledgments
Discord owns the Clyde character and Discord brand assets. This project is not affiliated with or endorsed by Discord.
Release files for discord-clyde 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| discord_clyde-1.1.0.tar.gz | 7.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| discord_clyde-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 MB
Release files / discord_clyde-1.1.0.tar.gz
| Download URL | discord_clyde-1.1.0.tar.gz |
|---|---|
| Size | 7.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b875a88c8675791b3deb3516c1b765d8db7686ea2b79f1e50383ca876532aee
|
|
BLAKE2b-256 checksum How to use checksums |
24d905e8a432bf921f2e2ad9c388a5f101b1675c5974fb1231ca2a675ae5624f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / discord_clyde-1.1.0-py3-none-any.whl
| Download URL | discord_clyde-1.1.0-py3-none-any.whl |
|---|---|
| Size | 53.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce87bf77bc525aa70a104cec1709f2c49e631ba0fc548af56d92012394076d48
|
|
BLAKE2b-256 checksum How to use checksums |
0c40852f653191fad76a673c819328e83c8106f517c7e59a5b3cd482d7e6985b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|