ReplyKeyboardMarkup
with few buttons (for example ["Yes", "No"]
)Yes"
) I want to display a message with inline keyboard and hide the buttons sent at step 1.Is it possible to do? The message has just single reply_markup
property and can be either InlinkeKeyboardMarkup
or ReplyKeyboardHide
. The only way to do that I see is to send 2 messages (first to hide keyboard and 2nd with inline keyboard) but that would not be best solution from user experience point of view. I'm OK to do couple of request but want to have just 1 message visible to user.
Any thoughts?
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.
Getting StartedOpen the telegram app and search for @BotFather. Click on the start button or send “/start”. Then send “/newbot” message to set up a name and a username. After setting name and username BotFather will give you an API token which is your bot token.
In order to send a message to "@Username", you will need them to start your bot, and then store the username with the user_id. Then, you can input the username to find the correct user_id each time you want to send them a message.
On Telegram, you can send messages in private chats and groups without making your phone number visible.
There isn't any logical solution. but there's a trick. you can send a message to remove the previous keyboard, then remove this message, finally send the next message with it's keyboard.
// send a fake message
Message sentMsg = bot.SendTextMessageAsync(chatID, ".", replyKeyboardMarkup: new ReplyKeyboardRemove()).Result;
// remove the fake message
bot.DeleteMessageAsync(chatID, sentMsg.MessageId);
// send the main message with it's keyboard
bot.SendTextMessageAsync(chatID, "the next message", replyKeyboardMarkup: new ReplyKeyboardMarkup(keyboardData));
It's impossible right now. Telegram Bot API currently allows sending only one type of keyboard: inline or simple (including KeyboardHide and other).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With