mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 03:31:10 +00:00
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import {
|
|
defineBundledChannelEntry,
|
|
loadBundledEntryExportSync,
|
|
} from "openclaw/plugin-sdk/channel-entry-contract";
|
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
|
|
function registerSlashCommandRoute(api: OpenClawPluginApi): void {
|
|
const register = loadBundledEntryExportSync<(api: OpenClawPluginApi) => void>(import.meta.url, {
|
|
specifier: "./runtime-api.js",
|
|
exportName: "registerSlashCommandRoute",
|
|
});
|
|
register(api);
|
|
}
|
|
|
|
export default defineBundledChannelEntry({
|
|
id: "mattermost",
|
|
name: "Mattermost",
|
|
description: "Mattermost channel plugin",
|
|
importMetaUrl: import.meta.url,
|
|
plugin: {
|
|
specifier: "./channel-plugin-api.js",
|
|
exportName: "mattermostPlugin",
|
|
},
|
|
secrets: {
|
|
specifier: "./src/secret-contract.js",
|
|
exportName: "channelSecrets",
|
|
},
|
|
runtime: {
|
|
specifier: "./runtime-api.js",
|
|
exportName: "setMattermostRuntime",
|
|
},
|
|
registerFull(api) {
|
|
// Actual slash-command registration happens after the monitor connects and
|
|
// knows the team id; the route itself can be wired here.
|
|
registerSlashCommandRoute(api);
|
|
},
|
|
});
|