mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
fix: chatwoot integration
This commit is contained in:
parent
154dd4e9ba
commit
4e4caab970
@ -19,6 +19,8 @@
|
|||||||
* It is now possible to send images via the Evolution Channel
|
* 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)
|
* 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
|
* Fixed typebot ignoreJids being used only from default settings
|
||||||
|
* Fixed Chatwoot inbox creation on save
|
||||||
|
* Changed axios timeout for manager requests for 30s
|
||||||
|
|
||||||
# 2.1.0 (2024-08-26 15:33)
|
# 2.1.0 (2024-08-26 15:33)
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
2
manager/dist/index.html
vendored
2
manager/dist/index.html
vendored
@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Evolution Manager</title>
|
<title>Evolution Manager</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DOHK1pp9.js"></script>
|
<script type="module" crossorigin src="/assets/index-Do1bGWiz.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-DNOCacL_.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-DNOCacL_.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -333,10 +333,10 @@ export class BusinessStartupService extends ChannelStartupService {
|
|||||||
const mediaType = message.messages[0].document
|
const mediaType = message.messages[0].document
|
||||||
? 'document'
|
? 'document'
|
||||||
: message.messages[0].image
|
: message.messages[0].image
|
||||||
? 'image'
|
? 'image'
|
||||||
: message.messages[0].audio
|
: message.messages[0].audio
|
||||||
? 'audio'
|
? 'audio'
|
||||||
: 'video';
|
: 'video';
|
||||||
|
|
||||||
const mimetype = result.headers['content-type'];
|
const mimetype = result.headers['content-type'];
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ export class ChatwootService {
|
|||||||
avatar_url: avatar_url,
|
avatar_url: avatar_url,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (jid.includes('@')) {
|
if ((jid && jid.includes('@')) || !jid) {
|
||||||
data['phone_number'] = `+${phoneNumber}`;
|
data['phone_number'] = `+${phoneNumber}`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1138,7 +1138,8 @@ export class ChatwootService {
|
|||||||
return { message: 'bot' };
|
return { message: 'bot' };
|
||||||
}
|
}
|
||||||
|
|
||||||
const chatId = body.conversation.meta.sender?.identifier;
|
const chatId =
|
||||||
|
body.conversation.meta.sender?.identifier || body.conversation.meta.sender?.phone_number.replace('+', '');
|
||||||
// Chatwoot to Whatsapp
|
// Chatwoot to Whatsapp
|
||||||
const messageReceived = body.content
|
const messageReceived = body.content
|
||||||
? body.content
|
? body.content
|
||||||
|
@ -238,14 +238,14 @@ export class DifyService {
|
|||||||
if (data.trim() === '' || !data.startsWith('{')) {
|
if (data.trim() === '' || !data.startsWith('{')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const events = data.split('\n').filter((line) => line.trim() !== '');
|
const events = data.split('\n').filter((line) => line.trim() !== '');
|
||||||
|
|
||||||
for (const eventString of events) {
|
for (const eventString of events) {
|
||||||
if (eventString.trim().startsWith('{')) {
|
if (eventString.trim().startsWith('{')) {
|
||||||
const event = JSON.parse(eventString);
|
const event = JSON.parse(eventString);
|
||||||
|
|
||||||
if (event?.event === 'agent_message') {
|
if (event?.event === 'agent_message') {
|
||||||
console.log('event:', event);
|
console.log('event:', event);
|
||||||
conversationId = conversationId ?? event?.conversation_id;
|
conversationId = conversationId ?? event?.conversation_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user