mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 11:30:21 +00:00
refactor(channels): dedupe hook and monitor execution paths
This commit is contained in:
@@ -3,7 +3,7 @@ import type { Request, Response, NextFunction } from "express";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import { logVerbose } from "../globals.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { createNonExitingRuntime, type RuntimeEnv } from "../runtime.js";
|
||||
import { resolveLineAccount } from "./accounts.js";
|
||||
import { handleLineWebhookEvents } from "./bot-handlers.js";
|
||||
import type { LineInboundContext } from "./bot-message-context.js";
|
||||
@@ -26,13 +26,7 @@ export interface LineBot {
|
||||
}
|
||||
|
||||
export function createLineBot(opts: LineBotOptions): LineBot {
|
||||
const runtime: RuntimeEnv = opts.runtime ?? {
|
||||
log: console.log,
|
||||
error: console.error,
|
||||
exit: (code: number): never => {
|
||||
throw new Error(`exit ${code}`);
|
||||
},
|
||||
};
|
||||
const runtime: RuntimeEnv = opts.runtime ?? createNonExitingRuntime();
|
||||
|
||||
const cfg = opts.config ?? loadConfig();
|
||||
const account = resolveLineAccount({
|
||||
|
||||
Reference in New Issue
Block a user