mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 09:28:39 -06:00
remove duplicate
This commit is contained in:
parent
9e4e1ce8ec
commit
e30f196dad
@ -320,37 +320,6 @@ export class TypebotService {
|
|||||||
return sessions;
|
return sessions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async clearSessions(instance: InstanceDto, remoteJid: string) {
|
|
||||||
const findTypebot = await this.find(instance);
|
|
||||||
const sessions = (findTypebot.sessions as Session[]) ?? [];
|
|
||||||
|
|
||||||
const sessionWithRemoteJid = sessions.filter((session) => session.remoteJid === remoteJid);
|
|
||||||
|
|
||||||
if (sessionWithRemoteJid.length > 0) {
|
|
||||||
sessionWithRemoteJid.forEach((session) => {
|
|
||||||
sessions.splice(sessions.indexOf(session), 1);
|
|
||||||
});
|
|
||||||
|
|
||||||
const typebotData = {
|
|
||||||
enabled: findTypebot.enabled,
|
|
||||||
url: findTypebot.url,
|
|
||||||
typebot: findTypebot.typebot,
|
|
||||||
expire: findTypebot.expire,
|
|
||||||
keyword_finish: findTypebot.keyword_finish,
|
|
||||||
delay_message: findTypebot.delay_message,
|
|
||||||
unknown_message: findTypebot.unknown_message,
|
|
||||||
listening_from_me: findTypebot.listening_from_me,
|
|
||||||
sessions,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.create(instance, typebotData);
|
|
||||||
|
|
||||||
return sessions;
|
|
||||||
}
|
|
||||||
|
|
||||||
return sessions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async sendWAMessage(
|
public async sendWAMessage(
|
||||||
instance: InstanceDto,
|
instance: InstanceDto,
|
||||||
remoteJid: string,
|
remoteJid: string,
|
||||||
|
Loading…
Reference in New Issue
Block a user