fix(telegram): improve sticker vision + cache (#2548) (thanks @longjos)

This commit is contained in:
Ayaan Zaidi
2026-01-27 12:47:04 +05:30
committed by Ayaan Zaidi
parent 506bed5aed
commit 34fea720f8
11 changed files with 240 additions and 37 deletions

View File

@@ -10,6 +10,13 @@ vi.mock("../../../agents/tools/telegram-actions.js", () => ({
}));
describe("telegramMessageActions", () => {
it("excludes sticker actions when not enabled", () => {
const cfg = { channels: { telegram: { botToken: "tok" } } } as ClawdbotConfig;
const actions = telegramMessageActions.listActions({ cfg });
expect(actions).not.toContain("sticker");
expect(actions).not.toContain("sticker-search");
});
it("allows media-only sends and passes asVoice", async () => {
handleTelegramAction.mockClear();
const cfg = { channels: { telegram: { botToken: "tok" } } } as ClawdbotConfig;

View File

@@ -46,7 +46,7 @@ export const telegramMessageActions: ChannelMessageActionAdapter = {
if (gate("reactions")) actions.add("react");
if (gate("deleteMessage")) actions.add("delete");
if (gate("editMessage")) actions.add("edit");
if (gate("sticker")) {
if (gate("sticker", false)) {
actions.add("sticker");
actions.add("sticker-search");
}