grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.28k stars 112 forks source link

No types for parameter disable_web_page_preview #643

Closed straystreyk closed 1 week ago

straystreyk commented 1 week ago

Hello! When using bot.api.sendMessage with the disable_web_page_preview: true parameter, the typescript says that there is no such parameter, although when it is sent, everything works correctly.

bot.api.sendMessage(user.dataValues.telegram_id, text, {
              parse_mode: "HTML",
              reply_markup: keyboard,
              // @ts-ignore
              disable_web_page_preview: true,
            })
            .catch((e) => {
              console.log(e.message);
            });
KnorpelSenf commented 1 week ago

Good. That means you're using an outdated version of the Bot API and grammY caught it. You should update your code to the latest version.

The option was renamed in the Bot API in December, and there was a news post about it: https://t.me/grammyjs_news/58