Answer the question
In order to leave comments, you need to log in
Did you send a command when you clicked the KeyboardButton?
Hello. Can you please tell me how to send a command when pressing the KeyboardButton button, for example, when pressing the Settings button, the /settings command is sent.
Of course, you can make the command the name of the "/settings" button, but this is somehow ugly. I write in ruby, but the example is suitable from any language, I think I can figure it out.
markup = Telegram::Bot::Types::ReplyKeyboardMarkup.new(keyboard: [%w(Settings), %w(Help)], resize_keyboard: true, one_time_keyboard: true)
respond_with :message, text: I18n.t(:settings), reply_markup: markup.to_hash
Answer the question
In order to leave comments, you need to log in
no way to do "normal".
It is necessary to map the words to the necessary commands in the code.
I use a lazy option on buttons text in the form "/r Command"
Where /r is a command that runs other commands by "keyword".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question