Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { getLoadedChannelPluginById } from "../../channels/plugins/registry-loaded.js";
import type { ChannelPlugin } from "../../channels/plugins/types.plugin.js";
import { normalizeAnyChannelId } from "../../channels/registry.js";
import {
normalizeOptionalLowercaseString,
normalizeOptionalString,
} from "../../shared/string-coerce.js";
import { extractSimpleExplicitGroupId } from "./group-id-simple.js";
export { extractSimpleExplicitGroupId };
export function extractExplicitGroupId(raw: string | undefined | null): string | undefined {
const trimmed = normalizeOptionalString(raw) ?? "";
if (!trimmed) {
return undefined;
}
const simple = extractSimpleExplicitGroupId(trimmed);
if (simple) {
return simple;
}
const firstPart = trimmed.split(":").find(Boolean);
const channelId =
normalizeAnyChannelId(firstPart ?? "") ?? normalizeOptionalLowercaseString(firstPart);
const messaging = channelId
? (getLoadedChannelPluginById(channelId) as ChannelPlugin | undefined)?.messaging
: undefined;
const parsed = messaging?.parseExplicitTarget?.({ raw: trimmed }) ?? null;
if (parsed && parsed.chatType && parsed.chatType !== "direct") {
return parsed.to.replace(/:topic:.*$/, "") || undefined;
}
return undefined;
}
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland