From 65fa11316e7d78e15f926d62e604f02784d0736e Mon Sep 17 00:00:00 2001 From: disqualifier Date: Mon, 6 Jul 2026 19:29:55 -0400 Subject: [PATCH] fix: safe_send empty-fallback no longer re-injects whitespace-only content When chunk_text dropped a whitespace-only content to [] and there were no embeds, the empty-messages fallback re-sent the raw original content - the exact whitespace 444e08b set out to eliminate, which Discord 50006s. The fallback now sends content=None so a files/view-only call still goes out as one message, and whitespace-only content is never forwarded raw; a genuinely empty send remains the caller's fail-loud error. Signed-off-by: disqualifier --- src/dpy_commons/send.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dpy_commons/send.py b/src/dpy_commons/send.py index 1e99e11..d43e6cf 100644 --- a/src/dpy_commons/send.py +++ b/src/dpy_commons/send.py @@ -72,7 +72,10 @@ async def safe_send( first = False if not messages: - messages.append(await _send(destination, content, None, True, per_chunk, once_only)) + # nothing chunked out (no content, or whitespace-only that chunk_text dropped) and no + # embeds: send content=None so a files/view-only call still goes out as one message, + # WITHOUT re-injecting the raw whitespace chunk_text discarded (which Discord 50006s) + messages.append(await _send(destination, None, None, True, per_chunk, once_only)) return messages