fix(discord): handle voice messages with empty content

Discord voice messages have empty `content` with the audio in attachments.
The nullish coalescing operator (`??`) doesn't fall through on empty strings,
so voice messages were being dropped as 'empty content'.

Changed to logical OR (`||`) so empty string falls through to media placeholder.
This commit is contained in:
VAC 2026-01-06 17:37:16 -05:00 committed by Peter Steinberger
parent 8901f28659
commit 0d6e65bd86

View File

@ -662,9 +662,9 @@ export function createDiscordMessageHandler(params: {
const media = await resolveMedia(message, mediaMaxBytes);
const text =
message.content?.trim() ??
media?.placeholder ??
message.embeds?.[0]?.description ??
message.content?.trim() ||
media?.placeholder ||
message.embeds?.[0]?.description ||
"";
if (!text) {
logVerbose(`discord: drop message ${message.id} (empty content)`);