Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

fix for preview link

Open kauanzito opened this issue 2 years ago • 57 comments

link preview was not working as it should (show url info above message) here I bring a small solution for that, and also a better formatting of the file.

kauanzito avatar Aug 20 '22 19:08 kauanzito

Pelo menos aqui nunca vi funcionar a função de link preview, pelo contrario, quando iria enviar uma mensagem mencionando alguns membros, a menção não funcionava corretamente.

undefined-60 avatar Aug 20 '22 19:08 undefined-60

Pelo menos aqui nunca vi funcionar a função de link preview, pelo contrario, quando iria enviar uma mensagem mencionando alguns membros, a menção não funcionava corretamente.

give me an example of how you are doing the sending, you are using the example: sock.sendMessage(jid, { text: text, mentions: [jids] }) ?

kauanzito avatar Aug 20 '22 19:08 kauanzito

uso assim: sock.sendMessage(id, { text: text, contextInfo: { mentionedJid: [mentions] } });

undefined-60 avatar Aug 20 '22 20:08 undefined-60

uso assim: sock.sendMessage(id, { text: text, contextInfo: { mentionedJid: [mentions] } });

there is no longer this "mentionedJid" in the submission, and it is not necessary to apply the "contextInfo" to use the mentions, use the way I gave you as an example...

kauanzito avatar Aug 20 '22 20:08 kauanzito

Que legal!

CaRLos1227 avatar Aug 20 '22 23:08 CaRLos1227

well done, thx

LorranX avatar Aug 20 '22 23:08 LorranX

god help

itmor avatar Aug 20 '22 23:08 itmor

Changing the file formatting does not "solve" the problem. I'm using it perfectly and it's not having any problems. So I don't think changes should be made.

viniciusgdr avatar Aug 21 '22 00:08 viniciusgdr

Maybe you haven't installed link-preview-js. Because the function requires the same.

Try installing by: npm i link-preview-js or yarn add link-preview-js

viniciusgdr avatar Aug 21 '22 00:08 viniciusgdr

Changing the file formatting does not "solve" the problem. I'm using it perfectly and it's not having any problems. So I don't think changes should be made.

Changing the file formatting does not "solve" the problem. I'm using it perfectly and it's not having any problems. So I don't think changes should be made.

if you look closer you will see that the formatting is just an append, the real change was in the "urlInfo"

kauanzito avatar Aug 21 '22 00:08 kauanzito

Maybe you haven't installed link-preview-js. Because the function requires the same.

Try installing by: npm i link-preview-js or yarn add link-preview-js

we tried this way and it continued without showing preview link.

kauanzito avatar Aug 21 '22 00:08 kauanzito

Many users are reporting on this issue in groups and communities, for some it works normally but for many it has been causing stress, I know people who chose to use external modules to achieve good performance, I think it is important to fix this error for us not need to go after external modules and adaptations😔

CoderThi avatar Aug 21 '22 00:08 CoderThi

Many users are reporting on this issue in groups and communities, for some it works normally but for many it has been causing stress, I know people who chose to use external modules to achieve good performance, I think it is important to fix this error for us not need to go after external modules and adaptations😔

this is real, and i bring this brief solution.

kauanzito avatar Aug 21 '22 00:08 kauanzito

I know that for some this module is working perfectly, but man even downloading and reevaluating the modules and updating it doesn't work, and that's annoying I waste the time I would have to develop new commands in adding a new external module and adapting it, "nobody deserve"

thiago02-rgb avatar Aug 21 '22 00:08 thiago02-rgb

I know that for some this module is working perfectly, but man even downloading and reevaluating the modules and updating it doesn't work, and that's annoying I waste the time I would have to develop new commands in adding a new external module and adapting it, "nobody deserve"

it's really quite annoying even having to install external modules to "generate" a preview link, which should work perfectly for 100% of users.

and that's why I bring the solution for everyone.

kauanzito avatar Aug 21 '22 00:08 kauanzito

no explicit workaround was done in the file. Only the formatting was witnessed in it. Be clear when submitting a PR.

Example: await sock.sendMessage(id, { text: 'Hi, this was sent using https://github.com/adiwajshing/baileys' })

viniciusgdr avatar Aug 21 '22 00:08 viniciusgdr

Link preview works fine for me as well, like it does for @viniciusgdr. Quickly checking open issues, there doesn't seem to be any related to link preview not working.

Also when making prs; make them clear. Don't just smash bunch of unnecessary formatting (which I don't think is needed) along your edit. It's a pain in the ass to review or even try to find what you tried to edit with the 'hint' you gave.

Also please use English as not everyone knows your language.

SheIITear avatar Aug 21 '22 00:08 SheIITear

no explicit workaround was done in the file. Only the formatting was witnessed in it. Be clear when submitting a PR.

Example: await sock.sendMessage(id, { text: 'Hi, this was sent using https://github.com/adiwajshing/baileys' })

Ok, soon I will close this pull to open another one with only the change, without the formatting of the file so as not to confuse other people as it confused you.

kauanzito avatar Aug 21 '22 00:08 kauanzito

ink preview works fine for me as well, like it does for @viniciusgdr. Quickly checking open issues, there doesn't seem to be any related to link preview not working.

Also when making prs; make them clear. Don't just smash bunch of unnecessary formatting (which I don't think is needed) along your edit. It's a pain in the ass to review or even try to find what you tried to edit with the 'hint' you gave.

Also please use English as not everyone knows your language.

@SheIITear is it good like this?

no explicit workaround was done in the file. Only the formatting was witnessed in it. Be clear when submitting a PR. Example: await sock.sendMessage(id, { text: 'Hi, this was sent using https://github.com/adiwajshing/baileys' })

Ok, soon I will close this pull to open another one with only the change, without the formatting of the file so as not to confuse other people as it confused you.

@SheIITear it's better this way?

kauanzito avatar Aug 21 '22 00:08 kauanzito

There is no reason to change what is already working. Be clear. Submit Evidence, Clear Arguments.

I use it on many occasions for several important things, no problems were seen in my tests in the last hour.

viniciusgdr avatar Aug 21 '22 00:08 viniciusgdr

Talvez você não tenha instalado link-preview-js. Porque a função requer o mesmo.

Tente instalar por: npm i link-preview-js ou yarn add link-preview-js

Eu instalei o link-preview e ainda assim não foi aqui.

undefined-60 avatar Aug 21 '22 00:08 undefined-60

So... All the major changes that you did were on the code formatting? Link preview works fine for me, how it also works for @SheIITear and @viniciusgdr. Also, I tested the occasions where the error supposedly happens, and it's just a lack of a module that the repository documentation specifies. Try reading it next time.

Dakauann avatar Aug 21 '22 00:08 Dakauann

nesse navegador aqui tem a opção de traduzir a pagina não acho que o fato de usar o português implique em algo.

undefined-60 avatar Aug 21 '22 00:08 undefined-60

Então... Todas as principais mudanças que você fez foram na formatação do código? A visualização do link funciona bem para mim, como também funciona para@SheIITeare@viniciusgdr.

Eu não vi uma mudança drástica no codigo que foi apresentado, acho que o problema é outra coisa, aqui, mesmo tendo o link-preview instalado não gera as informações do url na mensagem.

undefined-60 avatar Aug 21 '22 00:08 undefined-60

Então... Todas as principais mudanças que você fez foram na formatação do código? A visualização do link funciona bem para mim, como também funciona para@SheIITeare@viniciusgdr.

Eu não vi uma mudança drástica no codigo que foi apresentado, acho que o problema é outra coisa, aqui, mesmo tendo o link-preview instalado não gera as informações do url na mensagem.

Then it may be a problem in your code...

Dakauann avatar Aug 21 '22 00:08 Dakauann

Então... Todas as principais mudanças que você fez na formatação do código? A visualização do link funciona bem para mim, como também funciona para@SheIITeare@viniciusgdr.

Eu não vi uma mudança drástica no código que foi apresentado, acho que o problema é outra coisa, aqui, mesmo tendo o link-preview instalado não gera as informações do url na mensagem.

Então pode ser um problema no seu código...

Talvez possa ser, mais no caso, isso parece acontecer com outras pessoas

undefined-60 avatar Aug 21 '22 00:08 undefined-60

Okay, I updated the pull.

kauanzito avatar Aug 21 '22 00:08 kauanzito

Okay, I updated the pull.

You didn't changed anything m8

Dakauann avatar Aug 21 '22 01:08 Dakauann

ou didn't changed anything m8

wait, it's on "pending"...

kauanzito avatar Aug 21 '22 01:08 kauanzito

Click here

kauanzito avatar Aug 21 '22 01:08 kauanzito