Skip to content

Commit 7fad08a

Browse files
fix(telegram): expose thread create CLI remap
1 parent 5d6216a commit 7fad08a

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

extensions/telegram/src/channel-actions.contract.test.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { installChannelActionsContractSuite } from "openclaw/plugin-sdk/channel-test-helpers";
22
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
3-
import { describe } from "vitest";
3+
import { describe, expect, it } from "vitest";
44
import { telegramPlugin } from "../api.js";
55

66
describe("telegram actions contract", () => {
@@ -21,4 +21,26 @@ describe("telegram actions contract", () => {
2121
},
2222
],
2323
});
24+
25+
it("exposes Telegram thread create CLI remapping through the exported plugin", () => {
26+
const request = telegramPlugin.actions?.resolveCliActionRequest?.({
27+
action: "thread-create",
28+
args: {
29+
channel: "telegram",
30+
target: "-1003894873578",
31+
threadName: "Build Updates",
32+
message: "hello",
33+
},
34+
});
35+
36+
expect(request).toEqual({
37+
action: "topic-create",
38+
args: {
39+
channel: "telegram",
40+
target: "-1003894873578",
41+
name: "Build Updates",
42+
message: "hello",
43+
},
44+
});
45+
});
2446
});

extensions/telegram/src/channel.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,14 @@ const telegramMessageActions: ChannelMessageActionAdapter = {
276276
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.describeMessageTool?.(ctx) ??
277277
telegramMessageActionsImpl.describeMessageTool?.(ctx) ??
278278
null,
279+
resolveCliActionRequest: (ctx) =>
280+
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.resolveCliActionRequest?.(
281+
ctx,
282+
) ??
283+
telegramMessageActionsImpl.resolveCliActionRequest?.(ctx) ?? {
284+
action: ctx.action,
285+
args: ctx.args,
286+
},
279287
extractToolSend: (ctx) =>
280288
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.extractToolSend?.(ctx) ??
281289
telegramMessageActionsImpl.extractToolSend?.(ctx) ??

0 commit comments

Comments
 (0)