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 media = await resolveMedia(message, mediaMaxBytes);
|
||||||
const text =
|
const text =
|
||||||
message.content?.trim() ??
|
message.content?.trim() ||
|
||||||
media?.placeholder ??
|
media?.placeholder ||
|
||||||
message.embeds?.[0]?.description ??
|
message.embeds?.[0]?.description ||
|
||||||
"";
|
"";
|
||||||
if (!text) {
|
if (!text) {
|
||||||
logVerbose(`discord: drop message ${message.id} (empty content)`);
|
logVerbose(`discord: drop message ${message.id} (empty content)`);
|
||||||
|
|||||||
Reference in New Issue
Block a user