class Tourmaline::Update

Overview

This object represents an incoming update. At most one of the optional parameters can be present in any given update.

Included Modules

Defined in:

tourmaline/types/api.cr
tourmaline/types/custom/update.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(update_id : Int32 | Int64, message : Tourmaline::Message | Nil = nil, edited_message : Tourmaline::Message | Nil = nil, channel_post : Tourmaline::Message | Nil = nil, edited_channel_post : Tourmaline::Message | Nil = nil, inline_query : Tourmaline::InlineQuery | Nil = nil, chosen_inline_result : Tourmaline::ChosenInlineResult | Nil = nil, callback_query : Tourmaline::CallbackQuery | Nil = nil, shipping_query : Tourmaline::ShippingQuery | Nil = nil, pre_checkout_query : Tourmaline::PreCheckoutQuery | Nil = nil, poll : Tourmaline::Poll | Nil = nil, poll_answer : Tourmaline::PollAnswer | Nil = nil, my_chat_member : Tourmaline::ChatMemberUpdated | Nil = nil, chat_member : Tourmaline::ChatMemberUpdated | Nil = nil, chat_join_request : Tourmaline::ChatJoinRequest | Nil = nil) #

[View source]

Instance Method Detail

def animation? #

[View source]
def anonymous_admin_message? #

[View source]
def audio? #

[View source]
def basketball? #

[View source]
def bold_entity? #

[View source]
def bot_command_entity? #

[View source]
def bot_message? #

[View source]
def bowling? #

[View source]
def callback_query : Tourmaline::CallbackQuery | Nil #

Optional. New incoming callback query


[View source]
def callback_query=(callback_query : Tourmaline::CallbackQuery | Nil) #

Optional. New incoming callback query


[View source]
def callback_query? #

[View source]
def caption? #

[View source]
def cashtag_entity? #

[View source]
def channel_chat_created? #

[View source]
def channel_forward_message? #

[View source]
def channel_message? #

[View source]
def channel_post : Tourmaline::Message | Nil #

Optional. New incoming channel post of any kind - text, photo, sticker, etc.


[View source]
def channel_post=(channel_post : Tourmaline::Message | Nil) #

Optional. New incoming channel post of any kind - text, photo, sticker, etc.


[View source]
def channel_post? #

[View source]
def chat_join_request : Tourmaline::ChatJoinRequest | Nil #

Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.


[View source]
def chat_join_request=(chat_join_request : Tourmaline::ChatJoinRequest | Nil) #

Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.


[View source]
def chat_member : Tourmaline::ChatMemberUpdated | Nil #

Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.


[View source]
def chat_member=(chat_member : Tourmaline::ChatMemberUpdated | Nil) #

Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.


[View source]
def chat_member? #

[View source]
def chat_shared? #

[View source]
def chats #

Returns all unique chats included in this update


[View source]
def chats(&block : Chat -> ) #

Yields each unique chat in this update to the block.


[View source]
def chosen_inline_result : Tourmaline::ChosenInlineResult | Nil #

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.


[View source]
def chosen_inline_result=(chosen_inline_result : Tourmaline::ChosenInlineResult | Nil) #

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.


[View source]
def chosen_inline_result? #

[View source]
def code_entity? #

[View source]
def connected_website? #

[View source]
def contact? #

[View source]
def dart? #

[View source]
def delete_chat_photo? #

[View source]
def dice? #

[View source]
def document? #

[View source]
def edited_channel_post : Tourmaline::Message | Nil #

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


[View source]
def edited_channel_post=(edited_channel_post : Tourmaline::Message | Nil) #

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


[View source]
def edited_channel_post? #

[View source]
def edited_message : Tourmaline::Message | Nil #

Optional. New version of a message that is known to the bot and was edited


[View source]
def edited_message=(edited_message : Tourmaline::Message | Nil) #

Optional. New version of a message that is known to the bot and was edited


[View source]
def edited_message? #

[View source]
def email_entity? #

[View source]
def football? #

[View source]
def forum_topic_closed? #

[View source]
def forum_topic_created? #

[View source]
def forum_topic_edited? #

[View source]
def forum_topic_reopened? #

[View source]
def forwarded_message? #

[View source]
def game? #

[View source]
def general_forum_topic_hidden? #

[View source]
def general_forum_topic_unhidden? #

[View source]
def group_chat_created? #

[View source]
def hashtag_entity? #

[View source]
def inline_query : Tourmaline::InlineQuery | Nil #

Optional. New incoming inline query


[View source]
def inline_query=(inline_query : Tourmaline::InlineQuery | Nil) #

Optional. New incoming inline query


[View source]
def inline_query? #

[View source]
def invoice? #

[View source]
def italic_entity? #

[View source]
def left_chat_member? #

[View source]
def location? #

[View source]
def media_group? #

[View source]
def mention_entity? #

[View source]
def message : Tourmaline::Message | Nil #

Optional. New incoming message of any kind - text, photo, sticker, etc.


[View source]
def message=(message : Tourmaline::Message | Nil) #

Optional. New incoming message of any kind - text, photo, sticker, etc.


[View source]
def message? #

[View source]
def message_auto_delete_timer_changed? #

[View source]
def migrate_from_chat_id? #

[View source]
def migrate_to_chat_id? #

[View source]
def my_chat_member : Tourmaline::ChatMemberUpdated | Nil #

Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.


[View source]
def my_chat_member=(my_chat_member : Tourmaline::ChatMemberUpdated | Nil) #

Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.


[View source]
def my_chat_member? #

[View source]
def new_chat_members? #

[View source]
def new_chat_photo? #

[View source]
def new_chat_title? #

[View source]
def passport_data? #

[View source]
def phone_number_entity? #

[View source]
def photo? #

[View source]
def pinned_message? #

[View source]
def poll : Tourmaline::Poll | Nil #

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


[View source]
def poll=(poll : Tourmaline::Poll | Nil) #

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


[View source]
def poll? #

[View source]
def poll_answer : Tourmaline::PollAnswer | Nil #

Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.


[View source]
def poll_answer=(poll_answer : Tourmaline::PollAnswer | Nil) #

Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.


[View source]
def poll_answer? #

[View source]
def pre_checkout_query : Tourmaline::PreCheckoutQuery | Nil #

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


[View source]
def pre_checkout_query=(pre_checkout_query : Tourmaline::PreCheckoutQuery | Nil) #

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


[View source]
def pre_checkout_query? #

[View source]
def pre_entity? #

[View source]
def proximity_alert_triggered? #

[View source]
def reply_markup? #

[View source]
def reply_message? #

[View source]
def shipping_query : Tourmaline::ShippingQuery | Nil #

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


[View source]
def shipping_query=(shipping_query : Tourmaline::ShippingQuery | Nil) #

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


[View source]
def shipping_query? #

[View source]
def slot_machine? #

[View source]
def soccerball? #

[View source]
def spoiler_entity? #

[View source]
def sticker? #

[View source]
def strikethrough_entity? #

[View source]
def successful_payment? #

[View source]
def supergroup_chat_created? #

[View source]
def text? #

[View source]
def text_link_entity? #

[View source]
def text_mention_entity? #

[View source]
def thread_message? #

[View source]
def underline_entity? #

[View source]
def update? #

[View source]
def update_actions : Array(UpdateAction) #

[View source]
def update_id : Int32 | Int64 #

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.


[View source]
def update_id=(update_id : Int32 | Int64) #

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.


[View source]
def url_entity? #

[View source]
def user_message? #

[View source]
def user_shared? #

[View source]
def users #

Returns all users included in this update as a Set


[View source]
def users(&block : User -> ) #

Yields each unique user in this update to the block.


[View source]
def venue? #

[View source]
def via_bot? #

[View source]
def video? #

[View source]
def video_chat_ended? #

[View source]
def video_chat_participants_invited? #

[View source]
def video_chat_scheduled? #

[View source]
def video_chat_started? #

[View source]
def video_note? #

[View source]
def voice? #

[View source]
def web_app_data? #

[View source]