Class: TelegramBot::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/telegram_bot/message.rb

Instance Method Summary collapse

Instance Method Details

#get_command_for(bot) ⇒ Object



20
21
22
# File 'lib/telegram_bot/message.rb', line 20

def get_command_for(bot)
  text && text.sub(Regexp.new("@#{bot.identity.username}($|\s|\.|,)", Regexp::IGNORECASE), '').strip
end

#reply {|reply| ... } ⇒ Object

Yields:



14
15
16
17
18
# File 'lib/telegram_bot/message.rb', line 14

def reply(&block)
  reply = OutMessage.new(chat: chat)
  yield reply if block_given?
  reply
end