mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:38:25 +00:00
fix: normalize telegram command mentions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { ClawdbotConfig } from "../config/types.js";
|
||||
import {
|
||||
type CommandNormalizeOptions,
|
||||
listChatCommands,
|
||||
listChatCommandsForConfig,
|
||||
normalizeCommandBody,
|
||||
@@ -8,11 +9,12 @@ import {
|
||||
export function hasControlCommand(
|
||||
text?: string,
|
||||
cfg?: ClawdbotConfig,
|
||||
options?: CommandNormalizeOptions,
|
||||
): boolean {
|
||||
if (!text) return false;
|
||||
const trimmed = text.trim();
|
||||
if (!trimmed) return false;
|
||||
const normalizedBody = normalizeCommandBody(trimmed);
|
||||
const normalizedBody = normalizeCommandBody(trimmed, options);
|
||||
if (!normalizedBody) return false;
|
||||
const lowered = normalizedBody.toLowerCase();
|
||||
const commands = cfg ? listChatCommandsForConfig(cfg) : listChatCommands();
|
||||
|
||||
Reference in New Issue
Block a user