openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
20 lines (19 loc) • 642 B
JavaScript
import { s as normalizeOptionalLowercaseString } from "./string-coerce-mnp54Vah.js";
//#region src/channels/chat-type.ts
/**
* Channel conversation kind normalization.
*
* Maps channel-specific direct/group/channel labels into OpenClaw chat types.
*/
/**
* Normalizes channel-specific chat type labels into OpenClaw conversation kinds.
*/
function normalizeChatType(raw) {
const value = normalizeOptionalLowercaseString(raw);
if (!value) return;
if (value === "direct" || value === "dm") return "direct";
if (value === "group") return "group";
if (value === "channel") return "channel";
}
//#endregion
export { normalizeChatType as t };