Class: TelegramBot::Message
- Inherits:
-
Struct
- Object
- Struct
- TelegramBot::Message
- Includes:
- AutoFromMethods
- Defined in:
- lib/telegram_bot/message.rb
Instance Attribute Summary collapse
-
#audio ⇒ Object
Returns the value of attribute audio.
-
#chat ⇒ Object
Returns the value of attribute chat.
-
#contact ⇒ Object
Returns the value of attribute contact.
-
#date ⇒ Object
Returns the value of attribute date.
-
#delete_chat_photo ⇒ Object
Returns the value of attribute delete_chat_photo.
-
#document ⇒ Object
Returns the value of attribute document.
-
#forward_date ⇒ Object
Returns the value of attribute forward_date.
-
#forward_from ⇒ Object
Returns the value of attribute forward_from.
-
#from ⇒ Object
Returns the value of attribute from.
-
#group_chat_created ⇒ Object
Returns the value of attribute group_chat_created.
-
#id ⇒ Object
Returns the value of attribute id.
-
#left_chat_participant ⇒ Object
Returns the value of attribute left_chat_participant.
-
#location ⇒ Object
Returns the value of attribute location.
-
#new_chat_participant ⇒ Object
Returns the value of attribute new_chat_participant.
-
#new_chat_photo ⇒ Object
Returns the value of attribute new_chat_photo.
-
#new_chat_title ⇒ Object
Returns the value of attribute new_chat_title.
-
#photo ⇒ Object
Returns the value of attribute photo.
-
#reply_to_message ⇒ Object
Returns the value of attribute reply_to_message.
-
#sticker ⇒ Object
Returns the value of attribute sticker.
-
#text ⇒ Object
Returns the value of attribute text.
-
#video ⇒ Object
Returns the value of attribute video.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from AutoFromMethods
Instance Attribute Details
#audio ⇒ Object
Returns the value of attribute audio
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def audio @audio end |
#chat ⇒ Object
Returns the value of attribute chat
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def chat @chat end |
#contact ⇒ Object
Returns the value of attribute contact
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def contact @contact end |
#date ⇒ Object
Returns the value of attribute date
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def date @date end |
#delete_chat_photo ⇒ Object
Returns the value of attribute delete_chat_photo
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def delete_chat_photo @delete_chat_photo end |
#document ⇒ Object
Returns the value of attribute document
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def document @document end |
#forward_date ⇒ Object
Returns the value of attribute forward_date
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def forward_date @forward_date end |
#forward_from ⇒ Object
Returns the value of attribute forward_from
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def forward_from @forward_from end |
#from ⇒ Object
Returns the value of attribute from
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def from @from end |
#group_chat_created ⇒ Object
Returns the value of attribute group_chat_created
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def group_chat_created @group_chat_created end |
#id ⇒ Object
Returns the value of attribute id
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def id @id end |
#left_chat_participant ⇒ Object
Returns the value of attribute left_chat_participant
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def left_chat_participant @left_chat_participant end |
#location ⇒ Object
Returns the value of attribute location
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def location @location end |
#new_chat_participant ⇒ Object
Returns the value of attribute new_chat_participant
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def new_chat_participant @new_chat_participant end |
#new_chat_photo ⇒ Object
Returns the value of attribute new_chat_photo
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def new_chat_photo @new_chat_photo end |
#new_chat_title ⇒ Object
Returns the value of attribute new_chat_title
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def new_chat_title @new_chat_title end |
#photo ⇒ Object
Returns the value of attribute photo
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def photo @photo end |
#reply_to_message ⇒ Object
Returns the value of attribute reply_to_message
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def @reply_to_message end |
#sticker ⇒ Object
Returns the value of attribute sticker
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def sticker @sticker end |
#text ⇒ Object
Returns the value of attribute text
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def text @text end |
#video ⇒ Object
Returns the value of attribute video
4 5 6 |
# File 'lib/telegram_bot/message.rb', line 4 def video @video end |
Class Method Details
.extra_types ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# 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 ⇒ Object
29 30 31 32 33 |
# File 'lib/telegram_bot/message.rb', line 29 def self.hash_key_aliases { :id => :message_id, } end |
Instance Method Details
#is_forward? ⇒ Boolean
73 74 75 |
# File 'lib/telegram_bot/message.rb', line 73 def is_forward? !!forward_from end |
#is_reply? ⇒ Boolean
77 78 79 |
# File 'lib/telegram_bot/message.rb', line 77 def is_reply? !! end |
#type ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# 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 |