class Telegrambot::Types::Message

Public Instance Methods

arguments() click to toggle source

@return [String]

# File lib/telegrambot/types/message.rb, line 47
def arguments
  if command?
    text.gsub(command, '').strip
  end
end
command() click to toggle source

@return [String]

# File lib/telegrambot/types/message.rb, line 40
def command
  if command?
    text.slice(entities.first.offset, entities.first.length)
  end
end
command?() click to toggle source

@return [Boolean]

# File lib/telegrambot/types/message.rb, line 35
def command?
    entities.first.type == "bot_command"
end