fix: normalize telegram command mentions

This commit is contained in:
Ayaan Zaidi
2026-01-11 21:06:04 +05:30
parent 933c157092
commit 68f6f3f0bd
5 changed files with 65 additions and 9 deletions

View File

@@ -71,4 +71,17 @@ describe("control command parsing", () => {
expect(hasControlCommand("prefix /send on")).toBe(false);
expect(hasControlCommand("/send on")).toBe(true);
});
it("ignores telegram commands addressed to other bots", () => {
expect(
hasControlCommand("/help@otherbot", undefined, {
botUsername: "clawdbot",
}),
).toBe(false);
expect(
hasControlCommand("/help@clawdbot", undefined, {
botUsername: "clawdbot",
}),
).toBe(true);
});
});