mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-08 06:54:24 +00:00
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:
committed by
Peter Steinberger
parent
def28a87b2
commit
a6337be3d1
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user