I just got acquainted with the keyboard buttons for telegram bots using the .KeyboardButton from the Telegram API documentation but I have an issue; so far I've only been able to design the buttons such that the output after clicking on the button is the same as it's caption/placeholder which is really not helpful for what I want to do.
I have commands set and all already so for example I want the output of a button labeled "Rules" to be /rules in order to initiate the command action instead of the bot output being "Rules". I'm working with Python although I'm open to anyone working on the same stuff in other languages.
you may add a space character to the KeyboardButton text and then parse it from the message, or, if you don't like spaces to appear at the start, just add them to the end. heh, that's not enough right, so soft hyphen might be used, it's hex is \xC2\xAD (it doesn't show up, at least at my telegrams).
so, that works for me,
hope mr.durov won't change that..
I've got pinged at SF because of downvote.. ye, okay, The question is about keyboard_markup, which creates buttons below text input area, they produce instant input, which prints button caption in the chat, the bot may parse them as commands (which normally start with "/" character), so the question is about how to distinguish them properly.. This is not recommended route (as it seems).
With inline_markup, you create buttons that produce callbacks with custom data, so there will be no user input in the chat.
How to make telegram keyboard button issue commands?