mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
refactor: adopt shared chat plugin builder
This commit is contained in:
@@ -188,7 +188,7 @@ export function buildChannelOutboundSessionRoute(params: {
|
||||
}
|
||||
|
||||
/** Options for a channel plugin entry that should register a channel capability. */
|
||||
type DefineChannelPluginEntryOptions<TPlugin extends ChannelPlugin = ChannelPlugin> = {
|
||||
type DefineChannelPluginEntryOptions<TPlugin = ChannelPlugin> = {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
@@ -241,7 +241,7 @@ type CreatedChannelPluginBase<TResolvedAccount> = Pick<
|
||||
* optionally exposes extra full-runtime registration such as tools or gateway
|
||||
* handlers that only make sense outside setup-only registration modes.
|
||||
*/
|
||||
export function defineChannelPluginEntry<TPlugin extends ChannelPlugin>({
|
||||
export function defineChannelPluginEntry<TPlugin>({
|
||||
id,
|
||||
name,
|
||||
description,
|
||||
@@ -257,7 +257,7 @@ export function defineChannelPluginEntry<TPlugin extends ChannelPlugin>({
|
||||
configSchema,
|
||||
register(api: OpenClawPluginApi) {
|
||||
setRuntime?.(api.runtime);
|
||||
api.registerChannel({ plugin });
|
||||
api.registerChannel({ plugin: plugin as ChannelPlugin });
|
||||
if (api.registrationMode !== "full") {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user