mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 09:31:41 +00:00
feat(telegram): add disableAudioPreflight config for groups and topics
This commit is contained in:
committed by
Peter Steinberger
parent
d89c25d69e
commit
d3cb85eaf5
@@ -393,11 +393,19 @@ export const buildTelegramMessageContext = async ({
|
||||
let bodyText = rawBody;
|
||||
const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
|
||||
|
||||
const disableAudioPreflight =
|
||||
firstDefined(topicConfig?.disableAudioPreflight, groupConfig?.disableAudioPreflight) === true;
|
||||
|
||||
// Preflight audio transcription for mention detection in groups
|
||||
// This allows voice notes to be checked for mentions before being dropped
|
||||
let preflightTranscript: string | undefined;
|
||||
const needsPreflightTranscription =
|
||||
isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0;
|
||||
isGroup &&
|
||||
requireMention &&
|
||||
hasAudio &&
|
||||
!hasUserText &&
|
||||
mentionRegexes.length > 0 &&
|
||||
!disableAudioPreflight;
|
||||
|
||||
if (needsPreflightTranscription) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user