Skip to content

Commit f03252a

Browse files
committed
fix: keep telegram dispatch eager
1 parent cead2ea commit f03252a

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

‎extensions/telegram/src/bot-message.ts‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,11 @@ import {
99
type TelegramMediaRef,
1010
} from "./bot-message-context.js";
1111
import type { TelegramMessageContextOptions } from "./bot-message-context.types.js";
12+
import { dispatchTelegramMessage } from "./bot-message-dispatch.js";
1213
import type { TelegramBotOptions } from "./bot.types.js";
1314
import { buildTelegramThreadParams } from "./bot/helpers.js";
1415
import type { TelegramContext, TelegramStreamMode } from "./bot/types.js";
1516

16-
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. */
2918
type TelegramMessageProcessorDeps = Omit<
3019
BuildTelegramMessageContextParams,
@@ -119,7 +108,6 @@ export const createTelegramMessageProcessor = (deps: TelegramMessageProcessorDep
119108
);
120109
}
121110
try {
122-
const { dispatchTelegramMessage } = await loadTelegramMessageDispatch();
123111
await dispatchTelegramMessage({
124112
context,
125113
bot,

0 commit comments

Comments
 (0)