grammyjs / grammY

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

No types for parameter disable_web_page_preview #643

Closed straystreyk closed 1 month ago

straystreyk commented 1 month 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 month 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