mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 12:06:54 -06:00
fix: typebot's wait now pauses the flow and composing is defined by the delay_message parameter in set typebot
This commit is contained in:
parent
b095c9dfb9
commit
3a37fd9d32
@ -8,6 +8,7 @@
|
|||||||
* Read messages from whatsapp in chatwoot
|
* Read messages from whatsapp in chatwoot
|
||||||
* Add support to use use redis in cacheservice
|
* Add support to use use redis in cacheservice
|
||||||
* Add support for labels
|
* Add support for labels
|
||||||
|
* Command to clearcache from chatwoot inbox
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
@ -32,6 +33,11 @@
|
|||||||
* Fix looping when deleting a message in chatwoot
|
* Fix looping when deleting a message in chatwoot
|
||||||
* When receiving a file from whatsapp, use the original filename in chatwoot if possible
|
* When receiving a file from whatsapp, use the original filename in chatwoot if possible
|
||||||
* Correction in the sendList Function
|
* Correction in the sendList Function
|
||||||
|
* Implement contact upsert in messaging-history.set
|
||||||
|
* Improve proxy error handling
|
||||||
|
* Refactor fetching participants for group in WhatsApp service
|
||||||
|
* Fixed problem where the typebot final keyword did not work
|
||||||
|
* Typebot's wait now pauses the flow and composing is defined by the delay_message parameter in set typebot
|
||||||
|
|
||||||
# 1.6.1 (2023-12-22 11:43)
|
# 1.6.1 (2023-12-22 11:43)
|
||||||
|
|
||||||
|
@ -450,8 +450,6 @@ export class TypebotService {
|
|||||||
|
|
||||||
async function processMessages(instance, messages, input, clientSideActions, eventEmitter, applyFormatting) {
|
async function processMessages(instance, messages, input, clientSideActions, eventEmitter, applyFormatting) {
|
||||||
for (const message of messages) {
|
for (const message of messages) {
|
||||||
const wait = findItemAndGetSecondsToWait(clientSideActions, message.id);
|
|
||||||
|
|
||||||
if (message.type === 'text') {
|
if (message.type === 'text') {
|
||||||
let formattedText = '';
|
let formattedText = '';
|
||||||
|
|
||||||
@ -467,7 +465,7 @@ export class TypebotService {
|
|||||||
await instance.textMessage({
|
await instance.textMessage({
|
||||||
number: remoteJid.split('@')[0],
|
number: remoteJid.split('@')[0],
|
||||||
options: {
|
options: {
|
||||||
delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000,
|
delay: instance.localTypebot.delay_message || 1000,
|
||||||
presence: 'composing',
|
presence: 'composing',
|
||||||
},
|
},
|
||||||
textMessage: {
|
textMessage: {
|
||||||
@ -480,7 +478,7 @@ export class TypebotService {
|
|||||||
await instance.mediaMessage({
|
await instance.mediaMessage({
|
||||||
number: remoteJid.split('@')[0],
|
number: remoteJid.split('@')[0],
|
||||||
options: {
|
options: {
|
||||||
delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000,
|
delay: instance.localTypebot.delay_message || 1000,
|
||||||
presence: 'composing',
|
presence: 'composing',
|
||||||
},
|
},
|
||||||
mediaMessage: {
|
mediaMessage: {
|
||||||
@ -494,7 +492,7 @@ export class TypebotService {
|
|||||||
await instance.mediaMessage({
|
await instance.mediaMessage({
|
||||||
number: remoteJid.split('@')[0],
|
number: remoteJid.split('@')[0],
|
||||||
options: {
|
options: {
|
||||||
delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000,
|
delay: instance.localTypebot.delay_message || 1000,
|
||||||
presence: 'composing',
|
presence: 'composing',
|
||||||
},
|
},
|
||||||
mediaMessage: {
|
mediaMessage: {
|
||||||
@ -508,7 +506,7 @@ export class TypebotService {
|
|||||||
await instance.audioWhatsapp({
|
await instance.audioWhatsapp({
|
||||||
number: remoteJid.split('@')[0],
|
number: remoteJid.split('@')[0],
|
||||||
options: {
|
options: {
|
||||||
delay: wait ? wait * 1000 : instance.localTypebot.delay_message || 1000,
|
delay: instance.localTypebot.delay_message || 1000,
|
||||||
presence: 'recording',
|
presence: 'recording',
|
||||||
encoding: true,
|
encoding: true,
|
||||||
},
|
},
|
||||||
@ -517,6 +515,13 @@ export class TypebotService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wait = findItemAndGetSecondsToWait(clientSideActions, message.id);
|
||||||
|
|
||||||
|
console.log('wait', wait);
|
||||||
|
if (wait) {
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, wait * 1000));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input) {
|
if (input) {
|
||||||
@ -534,7 +539,7 @@ export class TypebotService {
|
|||||||
await instance.textMessage({
|
await instance.textMessage({
|
||||||
number: remoteJid.split('@')[0],
|
number: remoteJid.split('@')[0],
|
||||||
options: {
|
options: {
|
||||||
delay: 1200,
|
delay: instance.localTypebot.delay_message || 1000,
|
||||||
presence: 'composing',
|
presence: 'composing',
|
||||||
},
|
},
|
||||||
textMessage: {
|
textMessage: {
|
||||||
|
Loading…
Reference in New Issue
Block a user