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:
@@ -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)`);
|
||||
|
||||
Reference in New Issue
Block a user