Miloud Mokkedem
Miloud Mokkedem

Reputation: 512

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

Upvotes: 14

Views: 42982

Answers (4)

Dawit Mengistu
Dawit Mengistu

Reputation: 61

open telegram mini app from telegram bot

If you're here to open your mini-app from that button, /setcommands is the wrong way to achieve that.

Here is how you can launch apps from telegram both

/mybots
select your bot
Bot Settings
Menu Button

Then add your url and tittle of your button

Upvotes: 4

Phat Tran
Phat Tran

Reputation: 3870

For simplicity, you can use BotFather and set it directly from there.

  1. Open BotFather - https://t.me/BotFather
  2. send him the command /setcommands

enter image description here

Upvotes: 3

Miloud Mokkedem
Miloud Mokkedem

Reputation: 512

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: "القائمة " },
]);

Upvotes: 8

Roj
Roj

Reputation: 1342

You can achieve this in two ways. Either by

Upvotes: 17

Related Questions