Skip to content

Commit 3af8f96

Browse files
committed
Add support for splitMessages and timePerChar in Integrations
1 parent d806134 commit 3af8f96

File tree

7 files changed

+36
-51
lines changed

7 files changed

+36
-51
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM node:20-alpine AS builder
33
RUN apk update && \
44
apk add git ffmpeg wget curl bash
55

6-
LABEL version="2.1.2" description="Api to control whatsapp features through http requests."
6+
LABEL version="2.2.0" description="Api to control whatsapp features through http requests."
77
LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes"
88
LABEL contact="contato@atendai.com"
99

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolution-api",
3-
"version": "2.1.2",
3+
"version": "2.2.0",
44
"description": "Rest api for communication with WhatsApp",
55
"main": "./dist/main.js",
66
"type": "commonjs",
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
-- AlterTable
2+
ALTER TABLE "Dify" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
3+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;
4+
5+
-- AlterTable
6+
ALTER TABLE "DifySetting" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
7+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;
8+
9+
-- AlterTable
10+
ALTER TABLE "EvolutionBot" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
11+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;
12+
13+
-- AlterTable
14+
ALTER TABLE "EvolutionBotSetting" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
15+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;
16+
17+
-- AlterTable
18+
ALTER TABLE "Flowise" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
19+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;
20+
21+
-- AlterTable
22+
ALTER TABLE "FlowiseSetting" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
23+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;
24+
25+
-- AlterTable
26+
ALTER TABLE "OpenaiBot" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
27+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;
28+
29+
-- AlterTable
30+
ALTER TABLE "OpenaiSetting" ADD COLUMN "splitMessages" BOOLEAN DEFAULT false,
31+
ADD COLUMN "timePerChar" INTEGER DEFAULT 50;

src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ export class EvolutionBotController extends ChatbotController implements Chatbot
767767
if (!listeningFromMe) listeningFromMe = settings.listeningFromMe;
768768
if (!stopBotFromMe) stopBotFromMe = settings.stopBotFromMe;
769769
if (!keepOpen) keepOpen = settings.keepOpen;
770-
if (!debounceTime) debounceTime = settings.debounceTime;
770+
if (debounceTime === undefined || debounceTime === null) debounceTime = settings.debounceTime;
771771
if (!ignoreJids) ignoreJids = settings.ignoreJids;
772772
if (splitMessages === undefined || splitMessages === null) splitMessages = settings?.splitMessages ?? false;
773773
if (timePerChar === undefined || timePerChar === null) timePerChar = settings?.timePerChar ?? 0;

src/api/integrations/chatbot/flowise/controllers/flowise.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ export class FlowiseController extends ChatbotController implements ChatbotContr
767767
if (!listeningFromMe) listeningFromMe = settings.listeningFromMe;
768768
if (!stopBotFromMe) stopBotFromMe = settings.stopBotFromMe;
769769
if (!keepOpen) keepOpen = settings.keepOpen;
770-
if (!debounceTime) debounceTime = settings.debounceTime;
770+
if (debounceTime === undefined || debounceTime === null) debounceTime = settings.debounceTime;
771771
if (!ignoreJids) ignoreJids = settings.ignoreJids;
772772
if (splitMessages === undefined || splitMessages === null) splitMessages = settings?.splitMessages ?? false;
773773
if (timePerChar === undefined || timePerChar === null) timePerChar = settings?.timePerChar ?? 0;

src/api/integrations/chatbot/openai/controllers/openai.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ export class OpenaiController extends ChatbotController implements ChatbotContro
10051005
if (!listeningFromMe) listeningFromMe = settings.listeningFromMe;
10061006
if (!stopBotFromMe) stopBotFromMe = settings.stopBotFromMe;
10071007
if (!keepOpen) keepOpen = settings.keepOpen;
1008-
if (!debounceTime) debounceTime = settings.debounceTime;
1008+
if (debounceTime === undefined || debounceTime === null) debounceTime = settings.debounceTime;
10091009
if (!ignoreJids) ignoreJids = settings.ignoreJids;
10101010
if (splitMessages === undefined || splitMessages === null) splitMessages = settings?.splitMessages ?? false;
10111011
if (timePerChar === undefined || timePerChar === null) timePerChar = settings?.timePerChar ?? 0;

src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -670,52 +670,6 @@ export class TypebotController extends ChatbotController implements ChatbotContr
670670
'init',
671671
prefilledVariables,
672672
);
673-
674-
// const response = await this.typebotService.createNewSession(instanceData, {
675-
// enabled: true,
676-
// url: url,
677-
// typebot: typebot,
678-
// remoteJid: remoteJid,
679-
// expire: expire,
680-
// keywordFinish: keywordFinish,
681-
// delayMessage: delayMessage,
682-
// unknownMessage: unknownMessage,
683-
// listeningFromMe: listeningFromMe,
684-
// stopBotFromMe: stopBotFromMe,
685-
// keepOpen: keepOpen,
686-
// prefilledVariables: prefilledVariables,
687-
// typebotId: findBot.id,
688-
// });
689-
690-
// if (response.session) {
691-
// await this.typebotService.sendWAMessage(
692-
// instanceData,
693-
// response.session,
694-
// {
695-
// expire: expire,
696-
// keywordFinish: keywordFinish,
697-
// delayMessage: delayMessage,
698-
// unknownMessage: unknownMessage,
699-
// listeningFromMe: listeningFromMe,
700-
// stopBotFromMe: stopBotFromMe,
701-
// keepOpen: keepOpen,
702-
// },
703-
// remoteJid,
704-
// response.messages,
705-
// response.input,
706-
// response.clientSideActions,
707-
// );
708-
709-
// this.waMonitor.waInstances[instance.instanceName].sendDataWebhook(Events.TYPEBOT_START, {
710-
// remoteJid: remoteJid,
711-
// url: url,
712-
// typebot: typebot,
713-
// prefilledVariables: prefilledVariables,
714-
// sessionId: `${response.sessionId}`,
715-
// });
716-
// } else {
717-
// throw new Error('Session ID not found in response');
718-
// }
719673
} else {
720674
const id = Math.floor(Math.random() * 10000000000).toString();
721675

0 commit comments

Comments
 (0)