forked from Tencent/openclaw-weixin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
24 lines (20 loc) · 876 Bytes
/
index.ts
File metadata and controls
24 lines (20 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
import { weixinPlugin } from "./src/channel.js";
import { assertHostCompatibility } from "./src/compat.js";
import { WeixinConfigSchema } from "./src/config/config-schema.js";
import { setWeixinRuntime } from "./src/runtime.js";
export default {
id: "openclaw-weixin",
name: "Weixin",
description: "Weixin channel (getUpdates long-poll + sendMessage)",
configSchema: buildChannelConfigSchema(WeixinConfigSchema),
register(api: OpenClawPluginApi) {
// Fail-fast: reject incompatible host versions before any side-effects.
assertHostCompatibility(api.runtime?.version);
if (api.runtime) {
setWeixinRuntime(api.runtime);
}
api.registerChannel({ plugin: weixinPlugin });
},
};