Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ export class EvolutionStartupService extends ChannelStartupService {
openAiDefaultSettings.speechToText &&
received?.message?.audioMessage
) {
messageRaw.message.speechToText = await this.openaiService.speechToText(
openAiDefaultSettings.OpenaiCreds,
received,
this.client.updateMediaMessage,
);
messageRaw.message.speechToText = await this.openaiService.speechToText(received);
}
}

Expand Down
14 changes: 5 additions & 9 deletions src/api/integrations/channel/meta/whatsapp.business.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,16 +501,12 @@ export class BusinessStartupService extends ChannelStartupService {
openAiDefaultSettings.speechToText &&
audioMessage
) {
messageRaw.message.speechToText = await this.openaiService.speechToText(
openAiDefaultSettings.OpenaiCreds,
{
message: {
mediaUrl: messageRaw.message.mediaUrl,
...messageRaw,
},
messageRaw.message.speechToText = await this.openaiService.speechToText({
message: {
mediaUrl: messageRaw.message.mediaUrl,
...messageRaw,
},
() => {},
);
});
}
}

Expand Down
12 changes: 2 additions & 10 deletions src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1298,11 +1298,7 @@
});

if (openAiDefaultSettings && openAiDefaultSettings.openaiCredsId && openAiDefaultSettings.speechToText) {
messageRaw.message.speechToText = await this.openaiService.speechToText(
openAiDefaultSettings.OpenaiCreds,
received,
this.client.updateMediaMessage,
);
messageRaw.message.speechToText = await this.openaiService.speechToText(received);
}
}

Expand All @@ -1311,7 +1307,7 @@
data: messageRaw,
});

if (received.key.fromMe === false) {

Check failure on line 1310 in src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

View workflow job for this annotation

GitHub Actions / check-lint-and-build

Replace `remoteJid` with `·remoteJid·`
if (msg.status === status[3]) {
this.logger.log(`Update not read messages ${received.key.remoteJid}`);

Expand Down Expand Up @@ -1584,7 +1580,7 @@
if (this.configService.get<Database>('DATABASE').SAVE_DATA.MESSAGE_UPDATE)
await this.prismaRepository.messageUpdate.create({
data: message,
});

Check failure on line 1583 in src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

View workflow job for this annotation

GitHub Actions / check-lint-and-build

Replace `remoteJid}·=·key;·` with `·remoteJid·}·=·key;`

const existingChat = await this.prismaRepository.chat.findFirst({
where: { instanceId: this.instanceId, remoteJid: message.remoteJid },
Expand Down Expand Up @@ -2297,11 +2293,7 @@
});

if (openAiDefaultSettings && openAiDefaultSettings.openaiCredsId && openAiDefaultSettings.speechToText) {
messageRaw.message.speechToText = await this.openaiService.speechToText(
openAiDefaultSettings.OpenaiCreds,
messageRaw,
this.client.updateMediaMessage,
);
messageRaw.message.speechToText = await this.openaiService.speechToText(messageRaw);
}
}

Expand Down Expand Up @@ -3797,7 +3789,7 @@
}

return {
mediaType,

Check failure on line 3792 in src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

View workflow job for this annotation

GitHub Actions / check-lint-and-build

Delete `······`
fileName,
caption: mediaMessage['caption'],
size: {
Expand Down Expand Up @@ -3862,7 +3854,7 @@

const profile = await this.client.getBusinessProfile(jid);

if (!profile) {

Check failure on line 3857 in src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

View workflow job for this annotation

GitHub Actions / check-lint-and-build

Delete `··`
const info = await this.whatsappNumber({ numbers: [jid] });

return {
Expand Down
Loading
Loading