mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
Fix ignoreJids on typebot
This commit is contained in:
parent
9a1d5664c9
commit
aeb422b3f7
@ -18,6 +18,7 @@
|
||||
* Fixed chatwoot screen
|
||||
* It is now possible to send images via the Evolution Channel
|
||||
* Removed "version" from docker-compose as it is obsolete (https://dev.to/ajeetraina/do-we-still-use-version-in-compose-3inp)
|
||||
* Fixed typebot ignoreJids being used only from default settings
|
||||
|
||||
# 2.1.0 (2024-08-26 15:33)
|
||||
|
||||
|
@ -974,14 +974,6 @@ export class TypebotController extends ChatbotController implements ChatbotContr
|
||||
|
||||
if (!instanceData) throw new Error('Instance not found');
|
||||
|
||||
const settings = await this.prismaRepository.typebotSetting.findFirst({
|
||||
where: {
|
||||
instanceId: instance.instanceId,
|
||||
},
|
||||
});
|
||||
|
||||
if (this.checkIgnoreJids(settings?.ignoreJids, remoteJid)) return;
|
||||
|
||||
const session = await this.getSession(remoteJid, instance);
|
||||
|
||||
const content = getConversationMessage(msg);
|
||||
@ -996,6 +988,12 @@ export class TypebotController extends ChatbotController implements ChatbotContr
|
||||
|
||||
if (!findBot) return;
|
||||
|
||||
const settings = await this.prismaRepository.typebotSetting.findFirst({
|
||||
where: {
|
||||
instanceId: instance.instanceId,
|
||||
},
|
||||
});
|
||||
|
||||
const url = findBot?.url;
|
||||
const typebot = findBot?.typebot;
|
||||
let expire = findBot?.expire;
|
||||
@ -1006,32 +1004,19 @@ export class TypebotController extends ChatbotController implements ChatbotContr
|
||||
let stopBotFromMe = findBot?.stopBotFromMe;
|
||||
let keepOpen = findBot?.keepOpen;
|
||||
let debounceTime = findBot?.debounceTime;
|
||||
let ignoreJids = findBot?.ignoreJids;
|
||||
|
||||
if (
|
||||
!expire ||
|
||||
!keywordFinish ||
|
||||
!delayMessage ||
|
||||
!unknownMessage ||
|
||||
!listeningFromMe ||
|
||||
!stopBotFromMe ||
|
||||
!keepOpen
|
||||
) {
|
||||
if (!expire) expire = settings.expire;
|
||||
if (!expire) expire = settings.expire;
|
||||
if (!keywordFinish) keywordFinish = settings.keywordFinish;
|
||||
if (!delayMessage) delayMessage = settings.delayMessage;
|
||||
if (!unknownMessage) unknownMessage = settings.unknownMessage;
|
||||
if (!listeningFromMe) listeningFromMe = settings.listeningFromMe;
|
||||
if (!stopBotFromMe) stopBotFromMe = settings.stopBotFromMe;
|
||||
if (!keepOpen) keepOpen = settings.keepOpen;
|
||||
if (!debounceTime) debounceTime = settings.debounceTime;
|
||||
if (!ignoreJids) ignoreJids = settings.ignoreJids;
|
||||
|
||||
if (!keywordFinish) keywordFinish = settings.keywordFinish;
|
||||
|
||||
if (!delayMessage) delayMessage = settings.delayMessage;
|
||||
|
||||
if (!unknownMessage) unknownMessage = settings.unknownMessage;
|
||||
|
||||
if (!listeningFromMe) listeningFromMe = settings.listeningFromMe;
|
||||
|
||||
if (!stopBotFromMe) stopBotFromMe = settings.stopBotFromMe;
|
||||
|
||||
if (!keepOpen) keepOpen = settings.keepOpen;
|
||||
|
||||
if (!debounceTime) debounceTime = settings.debounceTime;
|
||||
}
|
||||
if (this.checkIgnoreJids(ignoreJids, remoteJid)) return;
|
||||
|
||||
const key = msg.key as {
|
||||
id: string;
|
||||
|
Loading…
Reference in New Issue
Block a user