Telegraf: Disable link preview

Created on 6 Jun 2017  路  3Comments  路  Source: telegraf/telegraf

I can not find in the docs how to disable the annoying link preview. Anyone knows how to?

question

Most helpful comment

Try following:

const { Extra} = require('telegraf')
bot.reply('Hello http://github.com', Extra.webPreview(false))

All 3 comments

Try following:

const { Extra} = require('telegraf')
bot.reply('Hello http://github.com', Extra.webPreview(false))

@dotcypress Unfortunately this solution doesn't work with replyWithHTML()
Do you know any alternative solution for this 馃憞
ctx.replyWithHTML(welcomeMSG, inlineButton, Extra.webPreview(false));

Extra.webPreview(false) returns an Extra, so you can chain it.

` let markup = Extra.webPreview(false).HTML().markup((m) => { return m.inlineKeyboard(m.callbackButton("text",action`));
});
ctx.reply("msg", markup);
```

Was this page helpful?
0 / 5 - 0 ratings

Related issues

agstover picture agstover  路  3Comments

bostrot picture bostrot  路  3Comments

Stephirio picture Stephirio  路  3Comments

expelliamus picture expelliamus  路  3Comments

rozi98 picture rozi98  路  3Comments