




















@@ -9,22 +9,11 @@ import {
99type TelegramMediaRef,
1010} from "./bot-message-context.js";
1111import type { TelegramMessageContextOptions } from "./bot-message-context.types.js";
12+import { dispatchTelegramMessage } from "./bot-message-dispatch.js";
1213import type { TelegramBotOptions } from "./bot.types.js";
1314import { buildTelegramThreadParams } from "./bot/helpers.js";
1415import type { TelegramContext, TelegramStreamMode } from "./bot/types.js";
151616-type TelegramMessageDispatchModule = Pick<
17-typeof import("./bot-message-dispatch.js"),
18-"dispatchTelegramMessage"
19->;
20-21-let telegramMessageDispatchPromise: Promise<TelegramMessageDispatchModule> | undefined;
22-23-async function loadTelegramMessageDispatch(): Promise<TelegramMessageDispatchModule> {
24-telegramMessageDispatchPromise ??= import("./bot-message-dispatch.js");
25-return await telegramMessageDispatchPromise;
26-}
27-2817/** Dependencies injected once when creating the message processor. */
2918type TelegramMessageProcessorDeps = Omit<
3019BuildTelegramMessageContextParams,
@@ -119,7 +108,6 @@ export const createTelegramMessageProcessor = (deps: TelegramMessageProcessorDep
119108);
120109}
121110try {
122-const { dispatchTelegramMessage } = await loadTelegramMessageDispatch();
123111await dispatchTelegramMessage({
124112 context,
125113 bot,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。