class Telegram::TelegramMessage

Attributes

chat[R]

@return [TelegramChat]

client[R]

@return [Telegram]

id[R]

@return [Integer]

raw[R]

@return [String]

raw_target[R]

targets to send a message

target[R]
time[R]

@return [Time]

user[R]

@return [TelegramContact] The user who sent this message

Public Class Methods

new(client, event) click to toggle source
# File lib/telegram/models.rb, line 131
def initialize(client, event)
  @event = event
  
  @id = event.id
  @raw = event.message.text
  @time = event.time
  @content_type = event.message.type

  @raw_sender = event.message.raw_from
  @raw_receiver = event.message.raw_to

  @user = @sender = event.message.from
  @receiver = event.message.to

  @target = case @receiver.type
  when 'user'
    @sender
  when 'chat', 'encr_chat'
    @receiver
  end
end

Public Instance Methods

reply(type, content, target=nil, &cb) click to toggle source
# File lib/telegram/models.rb, line 157
def reply(type, content, target=nil, &cb)
  target = @target if target.nil?
  if type == :text
    target.send_message(content, self)
  elsif type == :sticker 
  elsif type == :image
  end

end
reply_user(type, content) click to toggle source
# File lib/telegram/models.rb, line 153
def reply_user(type, content)

end