javascriptnode.jsbotstelegram-bottelegraf

how can I add menu button in telegram bot


how can I add Menu button in telegram bot using telegraf

menu button like this Menu


Solution

  • I create a menu button by add a new framework " Grammy "

    first install grammy : npm install grammy

    seconde add this code :

    const { Bot } = require("grammy");
    const bot = new Bot(BOT_TOKEN); // <-- place your bot token in this string
    

    create list of commands :

    bot.api.setMyCommands([
    { command: "start", description: "إبدأ من جديد" },
    { command: "help", description: "طلب مساعدة " },
    { command: "list", description: "القائمة " },
    ]);