Files
clawdbot/src/channels/chat-type.ts
2026-01-17 04:05:34 +00:00

12 lines
413 B
TypeScript

export type NormalizedChatType = "direct" | "group" | "channel";
export function normalizeChatType(raw?: string): NormalizedChatType | undefined {
const value = raw?.trim().toLowerCase();
if (!value) return undefined;
if (value === "direct" || value === "dm") return "direct";
if (value === "group") return "group";
if (value === "channel" || value === "room") return "channel";
return undefined;
}