Closed dzarezenko closed 7 years ago
What exactly is your main menu?
A keyboard message sent via the /start
command?
I call on \start
something like this:
[
'chat_id' => $chat_id,
'text' => $text,
'reply_markup' => new Longman\TelegramBot\Entities\Keyboard([
'keyboard' => [
[self::BTN_MARKET, self::BTN_BALANCES],
[self::BTN_RATES, self::BTN_ORDEDS]
],
'resize_keyboard' => true,
'one_time_keyboard' => false,
'selective' => false
])
];
There is no way to do this without sending another message that will re-display this menu.
You can use @BotFather
/setcommands
and add an entry with your command and label it as main menu item.
If you want a menu that doesn't vanish take a look at inline keyboards, they are essentialy better and nicer, not to mention whole menu and submenus can be contained within one message.
Ok, maybe you know, what is the best way to keep menu on top for users that don't know about menu. So, they don't know about /start
command for example and I want they use menu?
Most people will try writing /help or anything in chat, you might force the menu while replying to messages like this. Not really any other ideas, sorry.
In my opinion permanent keyboard are an anti pattern in bot developing. Use commands and inline keyboards
Hi,
I have implemented few bots already with this lib. But I have a common problem. My bots main menu runs on
/start
command execution. So users can see main menu on start of using my bots. But menu icon disappeared after some time or when you try to use bot on PC for example. And users should execute/start
command again to run the menu. But users don't know about that and as a result don't use menu at all.How can I keep menu icon always on top?