From a576d623a15b795ac65fcf2cc4346f20e85089e3 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Wed, 25 Mar 2026 05:02:22 +0900 Subject: [PATCH] fix: limit inline file parsing to data files only Restrict Discord attachment inline parsing to .txt, .md, .csv, .json, .log and text/* content type. Code files (.ts, .tsx, .js, .py, etc.) now show filename only instead of being inlined into the message. --- src/channels/discord.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/channels/discord.ts b/src/channels/discord.ts index 184c3fc..d355f4e 100644 --- a/src/channels/discord.ts +++ b/src/channels/discord.ts @@ -271,7 +271,7 @@ export class DiscordChannel implements Channel { return `[Audio: ${att.name || 'audio'}]`; } else if ( contentType.startsWith('text/') || - /\.(txt|md|json|csv|log|xml|yaml|yml|toml|ini|cfg|conf|sh|bash|zsh|py|js|ts|jsx|tsx|html|css|sql|rs|go|java|c|cpp|h|hpp|rb|php|swift|kt|scala|r|lua|pl|ex|exs|hs|ml|clj|dart|v|zig|nim|ps1|bat|cmd)$/i.test( + /\.(txt|md|csv|json|log)$/i.test( att.name || '', ) ) {