Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telegram inline keyboard and keyboard

I have question about Telegram bot. I want keyboard and inline keyboard, Can I enable both of the features at the same time ?

like image 658
Morteza Jalambadani Avatar asked Jan 19 '17 19:01

Morteza Jalambadani


People also ask

What is inline keyboard in Telegram?

Inline keyboards are available for messages sent both in chat mode and inline mode. Unlike with custom reply keyboards, pressing buttons on inline keyboards doesn't result in messages sent to the chat.

What is inline function Telegram bot?

Inline Telegram bots are those which can be summoned at will to offer a service in the middle of a chat session without having to go through the inconvenience of first leaving the chat.

Can I use HTML in Telegram?

Formatting Options You can use bold and italic text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.


1 Answers

According to Telegram documentation, it's currently impossible to pass two or more objects for reply_markup at the same time. reply_markup only accepts one of these objects at the same time:

  1. InlineKeyboardMarkup
  2. ReplyKeyboardMarkup
  3. ReplyKeyboardRemove
  4. ForceReply

And of course you cannot combine two or more objects together. If you wanna show keyboard and have inline keyboard too, you can show the keyboard in a message and after that send another message with inline keyboard.

Cheers,

like image 168
Sky Avatar answered Oct 01 '22 20:10

Sky