how can I add Menu button in telegram bot using telegraf
Asked
Active
Viewed 1.7k times
9

Miloud Mokkedem
- 432
- 1
- 5
- 14
-
Stack Overflow is a Q&A site; however it doesn’t seem you’ve asked a question. [ask] – esqew Jun 13 '22 at 08:08
3 Answers
11
You can achieve this in two ways. Either by
- using the
setMyCommands
method, or - contacting @BotFather to use its
/setcommands
command.

Roj
- 995
- 1
- 8
- 22
6
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: "القائمة " },
]);

Miloud Mokkedem
- 432
- 1
- 5
- 14
0
For simplicity, you can use BotFather and set it directly from there.
- Open BotFather - https://t.me/BotFather
- send him the command
/setcommands

Phat Tran
- 3,404
- 1
- 19
- 22