send() and send_any() retry with the exact same discord.File objects after healing a dead webhook, but discord.py closes every File on the first send's exit - a buffer-backed File's retry then uploads 0 bytes silently (the buffer sits at EOF and nothing calls reset()), and a path-backed File raises "I/O operation on closed file" instead. The healed retry in both methods now routes kwargs through _rebuild_files_in_kwargs(), which rebuilds a fresh discord.File per entry in file=/files= from its original source (reopens a path-backed File, rewinds a still-seekable buffer) before the retry send. A File that can't be safely rebuilt raises ValueError rather than silently sending an empty attachment. The first, non-retry send is untouched. Signed-off-by: disqualifier <dev@disqualifier.me>
16 lines
419 B
TOML
16 lines
419 B
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "dpy_webhooks"
|
|
version = "0.1.2"
|
|
description = "Per-channel Discord webhook management for discord.py — get-or-create, persist, enforce the cap, send. Config-free, injectable, installable."
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"discord.py>=2.2",
|
|
]
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/dpy_webhooks"]
|