File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,22 +9,11 @@ import {
99 type 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" ;
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. */
2918type 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,
You can’t perform that action at this time.
0 commit comments