refactor: use MAX_SLACK_MEDIA_FILES constant for file-only fallback

Replace the hardcoded limit of 5 with the existing
MAX_SLACK_MEDIA_FILES constant (8) from media.ts for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
justinhuangcode
2026-02-24 11:34:43 +00:00
committed by Peter Steinberger
parent def28a87b2
commit a6337be3d1
2 changed files with 3 additions and 2 deletions

View File

@@ -131,7 +131,7 @@ export type SlackMediaResult = {
placeholder: string;
};
const MAX_SLACK_MEDIA_FILES = 8;
export const MAX_SLACK_MEDIA_FILES = 8;
const MAX_SLACK_MEDIA_CONCURRENCY = 3;
const MAX_SLACK_FORWARDED_ATTACHMENTS = 8;

View File

@@ -44,6 +44,7 @@ import { stripSlackMentionsForCommandDetection } from "../commands.js";
import { normalizeSlackChannelType, type SlackMonitorContext } from "../context.js";
import {
resolveSlackAttachmentContent,
MAX_SLACK_MEDIA_FILES,
resolveSlackMedia,
resolveSlackThreadHistory,
resolveSlackThreadStarter,
@@ -369,7 +370,7 @@ export async function prepareSlackMessage(params: {
const fileOnlyFallback =
!mediaPlaceholder && (message.files?.length ?? 0) > 0
? message
.files!.slice(0, 5)
.files!.slice(0, MAX_SLACK_MEDIA_FILES)
.map((f) => f.name ?? "file")
.join(", ")
: undefined;