Fix link preview (#2681)

* Fix link preview

* Fix typo

* Fix preview options

* Add example for preview
This commit is contained in:
Shir Serlui 2023-12-12 20:56:44 +02:00 • committed by GitHub
commit ac0a50082f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 24 deletions

View file

@ -66,6 +66,9 @@ client.on('message', async msg => {
} else if (msg.body.startsWith('!echo ')) {
// Replies with the same message
msg.reply(msg.body.slice(6));
} else if (msg.body.startsWith('!preview ')) {
const text = msg.body.slice(9);
msg.reply(text, null, { linkPreview: true });
} else if (msg.body.startsWith('!desc ')) {
// Change the group description
let chat = await msg.getChat();