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.
This commit is contained in:
@@ -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 || '',
|
||||
)
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user