feat: improve gateway services and auto-reply commands

This commit is contained in:
Peter Steinberger
2026-01-11 02:17:10 +01:00
parent df55d45b6f
commit e0bf86f06c
52 changed files with 888 additions and 213 deletions

View File

@@ -1,13 +1,22 @@
import { listChatCommands, normalizeCommandBody } from "./commands-registry.js";
import type { ClawdbotConfig } from "../config/types.js";
import {
listChatCommands,
listChatCommandsForConfig,
normalizeCommandBody,
} from "./commands-registry.js";
export function hasControlCommand(text?: string): boolean {
export function hasControlCommand(
text?: string,
cfg?: ClawdbotConfig,
): boolean {
if (!text) return false;
const trimmed = text.trim();
if (!trimmed) return false;
const normalizedBody = normalizeCommandBody(trimmed);
if (!normalizedBody) return false;
const lowered = normalizedBody.toLowerCase();
for (const command of listChatCommands()) {
const commands = cfg ? listChatCommandsForConfig(cfg) : listChatCommands();
for (const command of commands) {
for (const alias of command.textAliases) {
const normalized = alias.trim().toLowerCase();
if (!normalized) continue;