mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-26 15:17:44 -06:00
fix: removed link preview endpoint, now it's done automatically from sending conventional text
This commit is contained in:
@@ -76,7 +76,6 @@ import {
|
||||
SendReactionDto,
|
||||
SendTextDto,
|
||||
SendPollDto,
|
||||
SendLinkPreviewDto,
|
||||
SendStickerDto,
|
||||
SendStatusDto,
|
||||
StatusMessage,
|
||||
@@ -1476,8 +1475,8 @@ export class WAStartupService {
|
||||
if (
|
||||
!message['audio'] &&
|
||||
!message['poll'] &&
|
||||
!message['linkPreview'] &&
|
||||
!message['sticker'] &&
|
||||
!message['conversation'] &&
|
||||
!sender.includes('@broadcast')
|
||||
) {
|
||||
if (!message['audio']) {
|
||||
@@ -1496,12 +1495,13 @@ export class WAStartupService {
|
||||
}
|
||||
}
|
||||
|
||||
if (message['linkPreview']) {
|
||||
if (message['conversation']) {
|
||||
console.log(message['conversation']);
|
||||
this.logger.verbose('Sending message');
|
||||
return await this.client.sendMessage(
|
||||
sender,
|
||||
{
|
||||
text: message['linkPreview'].text,
|
||||
text: message['conversation'],
|
||||
} as unknown as AnyMessageContent,
|
||||
option as unknown as MiscMessageGenerationOptions,
|
||||
);
|
||||
@@ -1583,19 +1583,6 @@ export class WAStartupService {
|
||||
);
|
||||
}
|
||||
|
||||
public async linkPreview(data: SendLinkPreviewDto) {
|
||||
this.logger.verbose('Sending link preview');
|
||||
return await this.sendMessageWithTyping(
|
||||
data.number,
|
||||
{
|
||||
linkPreview: {
|
||||
text: data.linkPreview.text,
|
||||
},
|
||||
},
|
||||
data?.options,
|
||||
);
|
||||
}
|
||||
|
||||
public async pollMessage(data: SendPollDto) {
|
||||
this.logger.verbose('Sending poll message');
|
||||
return await this.sendMessageWithTyping(
|
||||
@@ -2646,9 +2633,7 @@ export class WAStartupService {
|
||||
const msg = `${description}\n\n${inviteUrl}`;
|
||||
|
||||
const message = {
|
||||
linkPreview: {
|
||||
text: msg,
|
||||
},
|
||||
conversation: msg,
|
||||
};
|
||||
|
||||
for await (const number of numbers) {
|
||||
|
||||
Reference in New Issue
Block a user