class Update

This object represents an incoming update.

Public Instance Methods

callback_query() click to toggle source

Optional. New incoming callback query. Returns CallBackQuery object

# File lib/objects/update.rb, line 88
def callback_query
  query = @update.callback_query
  return CallBackQuery.new(qury) if query

  false
end
callback_query?() click to toggle source
# File lib/objects/update.rb, line 159
def callback_query?
  @update.callback_query ? true : false
end
channel_post() click to toggle source

New incoming channel post of any kind — text, photo, sticker, etc else false is returned.

# File lib/objects/update.rb, line 52
def channel_post
  c_post = @update.channel_post
  return Message.new(c_post) if c_post

  false
end
channel_post?() click to toggle source
# File lib/objects/update.rb, line 135
def channel_post?
  @update.channel_post ? true : false
end
chosen_inline_result() click to toggle source

Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

# File lib/objects/update.rb, line 80
def chosen_inline_result
  inline_result = @update.chosen_inline_result
  return ChoseInlineResult.new(inline_result) if inline_result

  false
end
chosen_inline_result?() click to toggle source
# File lib/objects/update.rb, line 155
def chosen_inline_result?
  @update.chosen_inline_result ? true : false
end
edited_channel_post() click to toggle source

New version of a channel post that is known to the bot and was edited. else false is returned.

# File lib/objects/update.rb, line 61
def edited_channel_post
  c_post = @update.edited_channel_post
  return Message.new(e_c_post) if c_post

  false
end
edited_channel_post?() click to toggle source
# File lib/objects/update.rb, line 143
def edited_channel_post?
  @update.edited_channel_post ? true : false
end
edited_message() click to toggle source

New version of a message that is known to the bot and was edited else false is returned.

# File lib/objects/update.rb, line 43
def edited_message
  e_msg = @update.edited_message
  return Message.new(e_msg) if e_msg

  false
end
edited_msg?() click to toggle source
# File lib/objects/update.rb, line 139
def edited_msg?
  @update.edited_message ? true : false
end
inline_query() click to toggle source

Optional. New incoming inline query.

# File lib/objects/update.rb, line 69
def inline_query
  i_query = @update.inline_query
  return InlineQuery.new(i_query) if i_query

  false
end
inline_query?() click to toggle source
# File lib/objects/update.rb, line 147
def inline_query?
  @update.inline_query ? true : false
end
message() click to toggle source

New incoming message of any kind — text, photo, sticker, etc else false is returned. returns Message object

# File lib/objects/update.rb, line 34
def message
  msg = @update.message
  return Message.new(msg) if msg

  false
end
msg?() click to toggle source
# File lib/objects/update.rb, line 131
def msg?
  @update.message ? true : false
end
new_state_poll?() click to toggle source
# File lib/objects/update.rb, line 151
def new_state_poll?
  @update.poll ? true : false
end
poll() click to toggle source

Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot.

# File lib/objects/update.rb, line 115
def poll
  pol = @udpate.poll
  return Poll.new(pol) if pol

  false
end
poll_answer() click to toggle source

New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot.

# File lib/objects/update.rb, line 124
def poll_answer
  p_answer = @update.poll_answer
  return PollAnswer.new(p_answer) if p_answer

  false
end
poll_answer?() click to toggle source
# File lib/objects/update.rb, line 171
def poll_answer?
  @update.poll_answer ? true : false
end
pre_checkout_query() click to toggle source

Optional. New incoming pre-checkout query. Contains full information about checkout

# File lib/objects/update.rb, line 106
def pre_checkout_query
  c_query = @update.pre_checkout_query
  return PreCheckoutQuery.new(p_c_query) if c_query

  false
end
pre_checkout_query?() click to toggle source
# File lib/objects/update.rb, line 167
def pre_checkout_query?
  @update.pre_checkout_query ? true : false
end
shipping_query() click to toggle source

Optional. New incoming shipping query. Only for invoices with flexible price

# File lib/objects/update.rb, line 97
def shipping_query
  s_query = @udpate.shipping_query
  return ShippingQuery.new(s_query) if s_query

  false
end
shipping_query?() click to toggle source
# File lib/objects/update.rb, line 163
def shipping_query?
  @update.shipping_query ? true : false
end
update_id() click to toggle source

The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.

# File lib/objects/update.rb, line 27
def update_id
  @update.update_id
end