class TelegramBot::Message
Public Class Methods
extra_types()
click to toggle source
# File lib/telegram_bot/message.rb, line 35 def self.extra_types { from: TelegramBot::User, chat: TelegramBot::Chat, forward_from: TelegramBot::User, forward_date: TelegramBot::Date, reply_to_message: TelegramBot::Message, audio: TelegramBot::Audio, document: TelegramBot::Document, photo: [ TelegramBot::PhotoSize], sticker: TelegramBot::Sticker, video: TelegramBot::Video, contact: TelegramBot::Contact, location: TelegramBot::Location, new_chat_participant: TelegramBot::User, left_chat_participant: TelegramBot::User } end
hash_key_aliases()
click to toggle source
# File lib/telegram_bot/message.rb, line 29 def self.hash_key_aliases { :id => :message_id, } end
Public Instance Methods
is_forward?()
click to toggle source
# File lib/telegram_bot/message.rb, line 73 def is_forward? !!forward_from end
is_reply?()
click to toggle source
# File lib/telegram_bot/message.rb, line 77 def is_reply? !!reply_to_message end
type()
click to toggle source
# File lib/telegram_bot/message.rb, line 54 def type case when text then :text when photo then :photo when audio then :audio when document then :document when sticker then :sticker when video then :video when contact then :contact when location then :location when new_chat_participant then :member_entered when left_chat_participant then :member_left when new_chat_title then :chat_title_updatd when new_chat_photo then :chat_photo_updated when delete_chat_photo then :chat_photo_deleted when group_chat_created then :group_chat_created end end