S
S
sasha_abdullin2017-02-21 21:20:14
ruby
sasha_abdullin, 2017-02-21 21:20:14

How to accept text from the keyboard of the Telegram Bot Ruby as input?

How to make a person enter text from the keyboard (do not select the proposed option, namely enter) and then have the opportunity to work with this text?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Chronic 86, 2017-02-21
@chronic86

You listen to everything through regular expressions. What is the difficulty?

require 'telegram/bot'

token = 'YOUR_TELEGRAM_BOT_API_TOKEN'

Telegram::Bot::Client.run(token) do |bot|
  bot.listen do |message|
    case message.text
    when /*сюда свою регулярку/
      do something
  end
end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question