mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-15 19:52:54 -06:00
fix: update description on chatbots
This commit is contained in:
parent
d7049e798c
commit
e8fa952de5
@ -332,6 +332,7 @@ export class DifyController extends ChatbotController implements ChatbotControll
|
||||
},
|
||||
data: {
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
botType: data.botType,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
|
@ -319,6 +319,7 @@ export class FlowiseController extends ChatbotController implements ChatbotContr
|
||||
},
|
||||
data: {
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
expire: data.expire,
|
||||
|
@ -319,6 +319,7 @@ export class GenericController extends ChatbotController implements ChatbotContr
|
||||
},
|
||||
data: {
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
expire: data.expire,
|
||||
|
@ -523,6 +523,7 @@ export class OpenaiController extends ChatbotController implements ChatbotContro
|
||||
},
|
||||
data: {
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
openaiCredsId: data.openaiCredsId,
|
||||
botType: data.botType,
|
||||
assistantId: data.assistantId,
|
||||
|
@ -335,6 +335,7 @@ export class TypebotController extends ChatbotController implements ChatbotContr
|
||||
},
|
||||
data: {
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
url: data.url,
|
||||
typebot: data.typebot,
|
||||
expire: data.expire,
|
||||
|
@ -63,14 +63,14 @@ export class WebhookController extends EventController implements EventControlle
|
||||
apiKey,
|
||||
local,
|
||||
}: EmitData): Promise<void> {
|
||||
const instance = (await this.get(instanceName)) as EventDto;
|
||||
const instance = (await this.get(instanceName)) as wa.LocalWebHook;
|
||||
|
||||
if (!instance || !instance.webhook?.enabled) {
|
||||
if (!instance || !instance?.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const webhookConfig = configService.get<Webhook>('WEBHOOK');
|
||||
const webhookLocal = instance.webhook?.events;
|
||||
const webhookLocal = instance?.events;
|
||||
const we = event.replace(/[.-]/gm, '_').toUpperCase();
|
||||
const transformedWe = we.replace(/_/gm, '-').toLowerCase();
|
||||
const enabledLog = configService.get<Log>('LOG').LEVEL.includes('WEBHOOKS');
|
||||
@ -79,7 +79,7 @@ export class WebhookController extends EventController implements EventControlle
|
||||
event,
|
||||
instance: instanceName,
|
||||
data,
|
||||
destination: instance.webhook?.url,
|
||||
destination: instance?.url,
|
||||
date_time: dateTime,
|
||||
sender,
|
||||
server_url: serverUrl,
|
||||
@ -90,10 +90,10 @@ export class WebhookController extends EventController implements EventControlle
|
||||
if (Array.isArray(webhookLocal) && webhookLocal.includes(we)) {
|
||||
let baseURL: string;
|
||||
|
||||
if (instance.webhook?.byEvents) {
|
||||
baseURL = `${instance.webhook?.url}/${transformedWe}`;
|
||||
if (instance?.webhookByEvents) {
|
||||
baseURL = `${instance?.url}/${transformedWe}`;
|
||||
} else {
|
||||
baseURL = instance.webhook?.url;
|
||||
baseURL = instance?.url;
|
||||
}
|
||||
|
||||
if (enabledLog) {
|
||||
@ -107,7 +107,7 @@ export class WebhookController extends EventController implements EventControlle
|
||||
}
|
||||
|
||||
try {
|
||||
if (instance.webhook?.enabled && isURL(instance.webhook.url, { require_tld: false })) {
|
||||
if (instance?.enabled && isURL(instance.url, { require_tld: false })) {
|
||||
const httpService = axios.create({ baseURL });
|
||||
|
||||
await httpService.post('', webhookData);
|
||||
|
Loading…
Reference in New Issue
Block a user