CAMBIO DE NO SALTO DE TEXTO
This commit is contained in:
AbrahamCordova96
2024-05-15 23:19:28 -07:00
committed by GitHub
parent c0e44b1296
commit 84899bd2ce

View File

@@ -13,10 +13,10 @@ const welcomeFlow = addKeyword<Provider, Database>(EVENTS.WELCOME)
.addAction(async (ctx, { flowDynamic, state, provider }) => {
await typing(ctx, provider)
const response = await toAsk(ASSISTANT_ID, ctx.body, state)
const chunks = response.split(/(?<!\d)\.\s+/g);
for (const chunk of chunks) {
await flowDynamic([{ body: chunk.trim() }]);
}
const chunks = response.split(/\n\n+/);
for (const chunk of chunks) {
await flowDynamic([{ body: chunk.trim() }]);
}
})
const main = async () => {
@@ -34,4 +34,4 @@ const main = async () => {
httpServer(+PORT)
}
main()
main()