mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 20:50:22 +00:00
Extensions: stabilize telegram registry contracts
This commit is contained in:
@@ -176,7 +176,6 @@ function expectClearedSessionBinding(params: {
|
||||
).toBeNull();
|
||||
}
|
||||
|
||||
const telegramDescribeMessageToolMock = vi.fn();
|
||||
const discordDescribeMessageToolMock = vi.fn();
|
||||
const sendMessageMatrixMock = vi.hoisted(() =>
|
||||
vi.fn(async (to: string, _message: string, opts?: { threadId?: string }) => ({
|
||||
@@ -185,16 +184,6 @@ const sendMessageMatrixMock = vi.hoisted(() =>
|
||||
})),
|
||||
);
|
||||
|
||||
setBundledChannelRuntime("telegram", {
|
||||
channel: {
|
||||
telegram: {
|
||||
messageActions: {
|
||||
describeMessageTool: telegramDescribeMessageToolMock,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as never);
|
||||
|
||||
setBundledChannelRuntime("discord", {
|
||||
channel: {
|
||||
discord: {
|
||||
@@ -394,17 +383,16 @@ export const actionContractRegistry: ActionsContractEntry[] = [
|
||||
plugin: requireBundledChannelPlugin("telegram"),
|
||||
cases: [
|
||||
{
|
||||
name: "forwards runtime-backed Telegram actions and capabilities",
|
||||
cfg: {} as OpenClawConfig,
|
||||
expectedActions: ["send", "poll", "react"],
|
||||
name: "exposes configured Telegram actions and capabilities",
|
||||
cfg: {
|
||||
channels: {
|
||||
telegram: {
|
||||
botToken: "123:telegram-test-token",
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig,
|
||||
expectedActions: ["send", "poll", "react", "delete", "edit", "topic-create", "topic-edit"],
|
||||
expectedCapabilities: ["interactive", "buttons"],
|
||||
beforeTest: () => {
|
||||
telegramDescribeMessageToolMock.mockReset();
|
||||
telegramDescribeMessageToolMock.mockReturnValue({
|
||||
actions: ["send", "poll", "react"],
|
||||
capabilities: ["interactive", "buttons"],
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user