tdlib-ruby 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/ChangeLog.md +5 -0
- data/README.md +9 -2
- data/bin/parser +32 -11
- data/lib/tdlib/client.rb +10 -5
- data/lib/tdlib/client_methods.rb +923 -386
- data/lib/tdlib/types.rb +176 -11
- data/lib/tdlib/types/animation.rb +2 -0
- data/lib/tdlib/types/audio.rb +2 -0
- data/lib/tdlib/types/authorization_state.rb +1 -0
- data/lib/tdlib/types/authorization_state/wait_code.rb +1 -6
- data/lib/tdlib/types/authorization_state/wait_password.rb +2 -2
- data/lib/tdlib/types/authorization_state/wait_registration.rb +9 -0
- data/lib/tdlib/types/auto_download_settings.rb +21 -0
- data/lib/tdlib/types/auto_download_settings_presets.rb +15 -0
- data/lib/tdlib/types/background.rb +19 -0
- data/lib/tdlib/types/background_type.rb +12 -0
- data/lib/tdlib/types/background_type/pattern.rb +12 -0
- data/lib/tdlib/types/background_type/solid.rb +8 -0
- data/lib/tdlib/types/background_type/wallpaper.rb +11 -0
- data/lib/tdlib/types/backgrounds.rb +8 -0
- data/lib/tdlib/types/basic_group.rb +0 -2
- data/lib/tdlib/types/basic_group_full_info.rb +2 -0
- data/lib/tdlib/types/call_problem.rb +16 -0
- data/lib/tdlib/types/call_problem/distorted_speech.rb +5 -0
- data/lib/tdlib/types/call_problem/dropped.rb +5 -0
- data/lib/tdlib/types/call_problem/echo.rb +5 -0
- data/lib/tdlib/types/call_problem/interruptions.rb +5 -0
- data/lib/tdlib/types/call_problem/noise.rb +5 -0
- data/lib/tdlib/types/call_problem/silent_local.rb +5 -0
- data/lib/tdlib/types/call_problem/silent_remote.rb +5 -0
- data/lib/tdlib/types/call_state/ready.rb +2 -0
- data/lib/tdlib/types/chat.rb +10 -0
- data/lib/tdlib/types/chat_event_action.rb +2 -0
- data/lib/tdlib/types/chat_event_action/invites_toggled.rb +3 -3
- data/lib/tdlib/types/chat_event_action/permissions_changed.rb +10 -0
- data/lib/tdlib/types/chat_event_action/photo_changed.rb +4 -4
- data/lib/tdlib/types/chat_event_action/poll_stopped.rb +8 -0
- data/lib/tdlib/types/chat_invite_link_info.rb +1 -1
- data/lib/tdlib/types/chat_member_status/administrator.rb +3 -3
- data/lib/tdlib/types/chat_member_status/restricted.rb +2 -13
- data/lib/tdlib/types/chat_members_filter.rb +1 -0
- data/lib/tdlib/types/chat_members_filter/contacts.rb +5 -0
- data/lib/tdlib/types/chat_notification_settings.rb +12 -0
- data/lib/tdlib/types/chat_permissions.rb +28 -0
- data/lib/tdlib/types/chat_photo.rb +2 -0
- data/lib/tdlib/types/chat_report_reason.rb +1 -0
- data/lib/tdlib/types/chat_report_reason/child_abuse.rb +5 -0
- data/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb +1 -1
- data/lib/tdlib/types/connection_state/waiting_for_network.rb +1 -1
- data/lib/tdlib/types/database_statistics.rb +8 -0
- data/lib/tdlib/types/device_token.rb +2 -2
- data/lib/tdlib/types/device_token/apple_push_vo_ip.rb +2 -0
- data/lib/tdlib/types/device_token/firebase_cloud_messaging.rb +10 -0
- data/lib/tdlib/types/document.rb +4 -1
- data/lib/tdlib/types/emojis.rb +8 -0
- data/lib/tdlib/types/file_part.rb +8 -0
- data/lib/tdlib/types/file_type/wallpaper.rb +1 -1
- data/lib/tdlib/types/http_url.rb +8 -0
- data/lib/tdlib/types/inline_keyboard_button_type.rb +1 -0
- data/lib/tdlib/types/inline_keyboard_button_type/login_url.rb +12 -0
- data/lib/tdlib/types/input_background.rb +11 -0
- data/lib/tdlib/types/input_background/local.rb +10 -0
- data/lib/tdlib/types/input_background/remote.rb +8 -0
- data/lib/tdlib/types/input_file/generated.rb +1 -0
- data/lib/tdlib/types/input_inline_query_result/animated_gif.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/animated_mpeg4.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/article.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/audio.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/contact.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/document.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/game.rb +2 -1
- data/lib/tdlib/types/input_inline_query_result/location.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/photo.rb +5 -3
- data/lib/tdlib/types/input_inline_query_result/sticker.rb +7 -6
- data/lib/tdlib/types/input_inline_query_result/venue.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/video.rb +5 -4
- data/lib/tdlib/types/input_inline_query_result/voice_note.rb +5 -4
- data/lib/tdlib/types/input_message_content.rb +1 -0
- data/lib/tdlib/types/input_message_content/forwarded.rb +7 -0
- data/lib/tdlib/types/input_message_content/poll.rb +11 -0
- data/lib/tdlib/types/input_thumbnail.rb +2 -2
- data/lib/tdlib/types/json_object_member.rb +10 -0
- data/lib/tdlib/types/json_value.rb +15 -0
- data/lib/tdlib/types/json_value/array.rb +8 -0
- data/lib/tdlib/types/json_value/boolean.rb +8 -0
- data/lib/tdlib/types/json_value/null.rb +5 -0
- data/lib/tdlib/types/json_value/number.rb +8 -0
- data/lib/tdlib/types/json_value/object.rb +8 -0
- data/lib/tdlib/types/json_value/string.rb +8 -0
- data/lib/tdlib/types/language_pack_info.rb +21 -0
- data/lib/tdlib/types/language_pack_string_value/pluralized.rb +1 -0
- data/lib/tdlib/types/link_state/is_contact.rb +1 -1
- data/lib/tdlib/types/link_state/knows_phone_number.rb +1 -1
- data/lib/tdlib/types/local_file.rb +5 -2
- data/lib/tdlib/types/log_stream.rb +12 -0
- data/lib/tdlib/types/log_stream/default.rb +5 -0
- data/lib/tdlib/types/log_stream/empty.rb +5 -0
- data/lib/tdlib/types/log_stream/file.rb +11 -0
- data/lib/tdlib/types/log_tags.rb +8 -0
- data/lib/tdlib/types/log_verbosity_level.rb +8 -0
- data/lib/tdlib/types/message.rb +3 -1
- data/lib/tdlib/types/message_content.rb +1 -0
- data/lib/tdlib/types/message_content/game_score.rb +1 -1
- data/lib/tdlib/types/message_content/pin_message.rb +1 -1
- data/lib/tdlib/types/message_content/poll.rb +8 -0
- data/lib/tdlib/types/message_forward_info.rb +13 -7
- data/lib/tdlib/types/message_forward_origin.rb +12 -0
- data/lib/tdlib/types/message_forward_origin/channel.rb +12 -0
- data/lib/tdlib/types/message_forward_origin/hidden_user.rb +8 -0
- data/lib/tdlib/types/message_forward_origin/user.rb +8 -0
- data/lib/tdlib/types/message_link_info.rb +14 -0
- data/lib/tdlib/types/message_sending_state/failed.rb +10 -0
- data/lib/tdlib/types/minithumbnail.rb +12 -0
- data/lib/tdlib/types/notification.rb +12 -0
- data/lib/tdlib/types/notification_group.rb +16 -0
- data/lib/tdlib/types/notification_group_type.rb +13 -0
- data/lib/tdlib/types/notification_group_type/calls.rb +5 -0
- data/lib/tdlib/types/notification_group_type/mentions.rb +6 -0
- data/lib/tdlib/types/notification_group_type/messages.rb +6 -0
- data/lib/tdlib/types/notification_group_type/secret_chat.rb +5 -0
- data/lib/tdlib/types/notification_settings_scope.rb +1 -0
- data/lib/tdlib/types/notification_settings_scope/channel_chats.rb +5 -0
- data/lib/tdlib/types/notification_settings_scope/group_chats.rb +2 -2
- data/lib/tdlib/types/notification_type.rb +13 -0
- data/lib/tdlib/types/notification_type/new_call.rb +8 -0
- data/lib/tdlib/types/notification_type/new_message.rb +8 -0
- data/lib/tdlib/types/notification_type/new_push_message.rb +15 -0
- data/lib/tdlib/types/notification_type/new_secret_chat.rb +5 -0
- data/lib/tdlib/types/option_value/boolean.rb +1 -1
- data/lib/tdlib/types/option_value/empty.rb +1 -1
- data/lib/tdlib/types/option_value/integer.rb +1 -1
- data/lib/tdlib/types/option_value/string.rb +1 -1
- data/lib/tdlib/types/page_block.rb +5 -0
- data/lib/tdlib/types/page_block/animation.rb +2 -2
- data/lib/tdlib/types/page_block/audio.rb +2 -2
- data/lib/tdlib/types/page_block/block_quote.rb +2 -2
- data/lib/tdlib/types/page_block/collage.rb +2 -2
- data/lib/tdlib/types/page_block/details.rb +12 -0
- data/lib/tdlib/types/page_block/embedded.rb +4 -4
- data/lib/tdlib/types/page_block/embedded_post.rb +4 -4
- data/lib/tdlib/types/page_block/kicker.rb +8 -0
- data/lib/tdlib/types/page_block/list.rb +3 -5
- data/lib/tdlib/types/page_block/map.rb +16 -0
- data/lib/tdlib/types/page_block/photo.rb +4 -2
- data/lib/tdlib/types/page_block/pull_quote.rb +2 -2
- data/lib/tdlib/types/page_block/related_articles.rb +10 -0
- data/lib/tdlib/types/page_block/slideshow.rb +2 -2
- data/lib/tdlib/types/page_block/table.rb +14 -0
- data/lib/tdlib/types/page_block/video.rb +2 -2
- data/lib/tdlib/types/page_block_caption.rb +10 -0
- data/lib/tdlib/types/page_block_horizontal_alignment.rb +12 -0
- data/lib/tdlib/types/page_block_horizontal_alignment/center.rb +5 -0
- data/lib/tdlib/types/page_block_horizontal_alignment/left.rb +5 -0
- data/lib/tdlib/types/page_block_horizontal_alignment/right.rb +5 -0
- data/lib/tdlib/types/page_block_list_item.rb +10 -0
- data/lib/tdlib/types/page_block_related_article.rb +18 -0
- data/lib/tdlib/types/page_block_table_cell.rb +18 -0
- data/lib/tdlib/types/page_block_vertical_alignment.rb +12 -0
- data/lib/tdlib/types/page_block_vertical_alignment/bottom.rb +5 -0
- data/lib/tdlib/types/page_block_vertical_alignment/middle.rb +5 -0
- data/lib/tdlib/types/page_block_vertical_alignment/top.rb +5 -0
- data/lib/tdlib/types/passport_authorization_form.rb +1 -5
- data/lib/tdlib/types/passport_element_error_source/file.rb +3 -0
- data/lib/tdlib/types/passport_element_error_source/translation_file.rb +3 -0
- data/lib/tdlib/types/passport_elements_with_errors.rb +10 -0
- data/lib/tdlib/types/password_state.rb +7 -7
- data/lib/tdlib/types/phone_number_authentication_settings.rb +16 -0
- data/lib/tdlib/types/photo.rb +2 -2
- data/lib/tdlib/types/poll.rb +16 -0
- data/lib/tdlib/types/poll_option.rb +16 -0
- data/lib/tdlib/types/profile_photo.rb +2 -0
- data/lib/tdlib/types/public_message_link.rb +1 -1
- data/lib/tdlib/types/push_message_content.rb +35 -0
- data/lib/tdlib/types/push_message_content/animation.rb +12 -0
- data/lib/tdlib/types/push_message_content/audio.rb +10 -0
- data/lib/tdlib/types/push_message_content/basic_group_chat_create.rb +5 -0
- data/lib/tdlib/types/push_message_content/chat_add_members.rb +12 -0
- data/lib/tdlib/types/push_message_content/chat_change_photo.rb +5 -0
- data/lib/tdlib/types/push_message_content/chat_change_title.rb +8 -0
- data/lib/tdlib/types/push_message_content/chat_delete_member.rb +12 -0
- data/lib/tdlib/types/push_message_content/chat_join_by_link.rb +5 -0
- data/lib/tdlib/types/push_message_content/contact.rb +10 -0
- data/lib/tdlib/types/push_message_content/contact_registered.rb +5 -0
- data/lib/tdlib/types/push_message_content/document.rb +10 -0
- data/lib/tdlib/types/push_message_content/game.rb +10 -0
- data/lib/tdlib/types/push_message_content/game_score.rb +12 -0
- data/lib/tdlib/types/push_message_content/hidden.rb +8 -0
- data/lib/tdlib/types/push_message_content/invoice.rb +10 -0
- data/lib/tdlib/types/push_message_content/location.rb +10 -0
- data/lib/tdlib/types/push_message_content/media_album.rb +12 -0
- data/lib/tdlib/types/push_message_content/message_forwards.rb +8 -0
- data/lib/tdlib/types/push_message_content/photo.rb +14 -0
- data/lib/tdlib/types/push_message_content/poll.rb +10 -0
- data/lib/tdlib/types/push_message_content/screenshot_taken.rb +5 -0
- data/lib/tdlib/types/push_message_content/sticker.rb +12 -0
- data/lib/tdlib/types/push_message_content/text.rb +10 -0
- data/lib/tdlib/types/push_message_content/video.rb +14 -0
- data/lib/tdlib/types/push_message_content/video_note.rb +10 -0
- data/lib/tdlib/types/push_message_content/voice_note.rb +10 -0
- data/lib/tdlib/types/push_receiver_id.rb +9 -0
- data/lib/tdlib/types/rich_text.rb +6 -0
- data/lib/tdlib/types/rich_text/anchor.rb +10 -0
- data/lib/tdlib/types/rich_text/icon.rb +13 -0
- data/lib/tdlib/types/rich_text/marked.rb +8 -0
- data/lib/tdlib/types/rich_text/phone_number.rb +10 -0
- data/lib/tdlib/types/rich_text/subscript.rb +8 -0
- data/lib/tdlib/types/rich_text/superscript.rb +8 -0
- data/lib/tdlib/types/scope_notification_settings.rb +6 -0
- data/lib/tdlib/types/search_messages_filter/unread_mention.rb +1 -1
- data/lib/tdlib/types/session.rb +3 -0
- data/lib/tdlib/types/sticker.rb +2 -0
- data/lib/tdlib/types/sticker_set.rb +10 -2
- data/lib/tdlib/types/sticker_set_info.rb +5 -0
- data/lib/tdlib/types/storage_statistics_fast.rb +4 -0
- data/lib/tdlib/types/supergroup.rb +2 -3
- data/lib/tdlib/types/supergroup_full_info.rb +2 -2
- data/lib/tdlib/types/supergroup_members_filter.rb +1 -0
- data/lib/tdlib/types/supergroup_members_filter/contacts.rb +8 -0
- data/lib/tdlib/types/terms_of_service.rb +1 -1
- data/lib/tdlib/types/update.rb +9 -0
- data/lib/tdlib/types/update/active_notifications.rb +10 -0
- data/lib/tdlib/types/update/chat_online_member_count.rb +12 -0
- data/lib/tdlib/types/update/chat_order.rb +1 -1
- data/lib/tdlib/types/update/chat_permissions.rb +10 -0
- data/lib/tdlib/types/update/chat_pinned_message.rb +11 -0
- data/lib/tdlib/types/update/delete_messages.rb +1 -1
- data/lib/tdlib/types/update/have_pending_notifications.rb +13 -0
- data/lib/tdlib/types/update/message_send_failed.rb +1 -1
- data/lib/tdlib/types/update/new_message.rb +0 -4
- data/lib/tdlib/types/update/notification.rb +10 -0
- data/lib/tdlib/types/update/notification_group.rb +26 -0
- data/lib/tdlib/types/update/poll.rb +8 -0
- data/lib/tdlib/types/update/selected_background.rb +10 -0
- data/lib/tdlib/types/updates.rb +8 -0
- data/lib/tdlib/types/user.rb +4 -0
- data/lib/tdlib/types/user_privacy_setting.rb +3 -0
- data/lib/tdlib/types/user_privacy_setting/allow_peer_to_peer_calls.rb +5 -0
- data/lib/tdlib/types/user_privacy_setting/show_link_in_forwarded_messages.rb +5 -0
- data/lib/tdlib/types/user_privacy_setting/show_profile_photo.rb +5 -0
- data/lib/tdlib/types/user_profile_photo.rb +12 -0
- data/lib/tdlib/types/user_profile_photos.rb +2 -2
- data/lib/tdlib/types/video.rb +2 -0
- data/lib/tdlib/types/video_note.rb +2 -0
- data/lib/tdlib/types/web_page.rb +3 -2
- data/lib/tdlib/types/web_page_instant_view.rb +7 -0
- data/lib/tdlib/update_manager.rb +5 -12
- data/lib/tdlib/version.rb +1 -1
- data/spec/integration/tdlib_spec.rb +8 -0
- metadata +139 -9
- data/lib/tdlib/types/device_token/google_cloud_messaging.rb +0 -8
- data/lib/tdlib/types/message_forward_info/message_forwarded_from_user.rb +0 -16
- data/lib/tdlib/types/message_forward_info/message_forwarded_post.rb +0 -21
- data/lib/tdlib/types/sticker_emojis.rb +0 -10
- data/lib/tdlib/types/wallpaper.rb +0 -14
- data/lib/tdlib/types/wallpapers.rb +0 -8
@@ -0,0 +1,16 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# A map.
|
3
|
+
#
|
4
|
+
# @attr location [TD::Types::Location] Location of the map center.
|
5
|
+
# @attr zoom [Integer] Map zoom level.
|
6
|
+
# @attr width [Integer] Map width.
|
7
|
+
# @attr height [Integer] Map height.
|
8
|
+
# @attr caption [TD::Types::PageBlockCaption] Block caption.
|
9
|
+
class PageBlock::Map < PageBlock
|
10
|
+
attribute :location, TD::Types::Location
|
11
|
+
attribute :zoom, TD::Types::Integer
|
12
|
+
attribute :width, TD::Types::Integer
|
13
|
+
attribute :height, TD::Types::Integer
|
14
|
+
attribute :caption, TD::Types::PageBlockCaption
|
15
|
+
end
|
16
|
+
end
|
@@ -2,9 +2,11 @@ module TD::Types
|
|
2
2
|
# A photo.
|
3
3
|
#
|
4
4
|
# @attr photo [TD::Types::Photo, nil] Photo file; may be null.
|
5
|
-
# @attr caption [TD::Types::
|
5
|
+
# @attr caption [TD::Types::PageBlockCaption] Photo caption.
|
6
|
+
# @attr url [String] URL that needs to be opened when the photo is clicked.
|
6
7
|
class PageBlock::Photo < PageBlock
|
7
8
|
attribute :photo, TD::Types::Photo.optional.default(nil)
|
8
|
-
attribute :caption, TD::Types::
|
9
|
+
attribute :caption, TD::Types::PageBlockCaption
|
10
|
+
attribute :url, TD::Types::String
|
9
11
|
end
|
10
12
|
end
|
@@ -2,9 +2,9 @@ module TD::Types
|
|
2
2
|
# A pull quote.
|
3
3
|
#
|
4
4
|
# @attr text [TD::Types::RichText] Quote text.
|
5
|
-
# @attr
|
5
|
+
# @attr credit [TD::Types::RichText] Quote credit.
|
6
6
|
class PageBlock::PullQuote < PageBlock
|
7
7
|
attribute :text, TD::Types::RichText
|
8
|
-
attribute :
|
8
|
+
attribute :credit, TD::Types::RichText
|
9
9
|
end
|
10
10
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Related articles.
|
3
|
+
#
|
4
|
+
# @attr header [TD::Types::RichText] Block header.
|
5
|
+
# @attr articles [Array<TD::Types::PageBlockRelatedArticle>] List of related articles.
|
6
|
+
class PageBlock::RelatedArticles < PageBlock
|
7
|
+
attribute :header, TD::Types::RichText
|
8
|
+
attribute :articles, TD::Types::Array.of(TD::Types::PageBlockRelatedArticle)
|
9
|
+
end
|
10
|
+
end
|
@@ -2,9 +2,9 @@ module TD::Types
|
|
2
2
|
# A slideshow.
|
3
3
|
#
|
4
4
|
# @attr page_blocks [Array<TD::Types::PageBlock>] Slideshow item contents.
|
5
|
-
# @attr caption [TD::Types::
|
5
|
+
# @attr caption [TD::Types::PageBlockCaption] Block caption.
|
6
6
|
class PageBlock::Slideshow < PageBlock
|
7
7
|
attribute :page_blocks, TD::Types::Array.of(TD::Types::PageBlock)
|
8
|
-
attribute :caption, TD::Types::
|
8
|
+
attribute :caption, TD::Types::PageBlockCaption
|
9
9
|
end
|
10
10
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# A table.
|
3
|
+
#
|
4
|
+
# @attr caption [TD::Types::RichText] Table caption.
|
5
|
+
# @attr cells [Array<Array<TD::Types::PageBlockTableCell>>] Table cells.
|
6
|
+
# @attr is_bordered [Boolean] True, if the table is bordered.
|
7
|
+
# @attr is_striped [Boolean] True, if the table is striped.
|
8
|
+
class PageBlock::Table < PageBlock
|
9
|
+
attribute :caption, TD::Types::RichText
|
10
|
+
attribute :cells, TD::Types::Array.of(TD::Types::Array.of(TD::Types::PageBlockTableCell))
|
11
|
+
attribute :is_bordered, TD::Types::Bool
|
12
|
+
attribute :is_striped, TD::Types::Bool
|
13
|
+
end
|
14
|
+
end
|
@@ -2,12 +2,12 @@ module TD::Types
|
|
2
2
|
# A video.
|
3
3
|
#
|
4
4
|
# @attr video [TD::Types::Video, nil] Video file; may be null.
|
5
|
-
# @attr caption [TD::Types::
|
5
|
+
# @attr caption [TD::Types::PageBlockCaption] Video caption.
|
6
6
|
# @attr need_autoplay [Boolean] True, if the video should be played automatically.
|
7
7
|
# @attr is_looped [Boolean] True, if the video should be looped.
|
8
8
|
class PageBlock::Video < PageBlock
|
9
9
|
attribute :video, TD::Types::Video.optional.default(nil)
|
10
|
-
attribute :caption, TD::Types::
|
10
|
+
attribute :caption, TD::Types::PageBlockCaption
|
11
11
|
attribute :need_autoplay, TD::Types::Bool
|
12
12
|
attribute :is_looped, TD::Types::Bool
|
13
13
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains a caption of an instant view web page block, consisting of a text and a trailing credit.
|
3
|
+
#
|
4
|
+
# @attr text [TD::Types::RichText] Content of the caption.
|
5
|
+
# @attr credit [TD::Types::RichText] Block credit (like HTML tag <cite>).
|
6
|
+
class PageBlockCaption < Base
|
7
|
+
attribute :text, TD::Types::RichText
|
8
|
+
attribute :credit, TD::Types::RichText
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Describes a horizontal alignment of a table cell content.
|
3
|
+
class PageBlockHorizontalAlignment < Base
|
4
|
+
%w[
|
5
|
+
left
|
6
|
+
center
|
7
|
+
right
|
8
|
+
].each do |type|
|
9
|
+
autoload TD::Types.camelize(type), "tdlib/types/page_block_horizontal_alignment/#{type}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Describes an item of a list page block.
|
3
|
+
#
|
4
|
+
# @attr label [String] Item label.
|
5
|
+
# @attr page_blocks [Array<TD::Types::PageBlock>] Item blocks.
|
6
|
+
class PageBlockListItem < Base
|
7
|
+
attribute :label, TD::Types::String
|
8
|
+
attribute :page_blocks, TD::Types::Array.of(TD::Types::PageBlock)
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains information about a related article.
|
3
|
+
#
|
4
|
+
# @attr url [String] Related article URL.
|
5
|
+
# @attr title [String, nil] Article title; may be empty.
|
6
|
+
# @attr description [String, nil] Article description; may be empty.
|
7
|
+
# @attr photo [TD::Types::Photo, nil] Article photo; may be null.
|
8
|
+
# @attr author [String, nil] Article author; may be empty.
|
9
|
+
# @attr publish_date [Integer] Point in time (Unix timestamp) when the article was published; 0 if unknown.
|
10
|
+
class PageBlockRelatedArticle < Base
|
11
|
+
attribute :url, TD::Types::String
|
12
|
+
attribute :title, TD::Types::String.optional.default(nil)
|
13
|
+
attribute :description, TD::Types::String.optional.default(nil)
|
14
|
+
attribute :photo, TD::Types::Photo.optional.default(nil)
|
15
|
+
attribute :author, TD::Types::String.optional.default(nil)
|
16
|
+
attribute :publish_date, TD::Types::Integer
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Represents a cell of a table.
|
3
|
+
#
|
4
|
+
# @attr text [TD::Types::RichText] Cell text.
|
5
|
+
# @attr is_header [Boolean] True, if it is a header cell.
|
6
|
+
# @attr colspan [Integer] The number of columns the cell should span.
|
7
|
+
# @attr rowspan [Integer] The number of rows the cell should span.
|
8
|
+
# @attr align [TD::Types::PageBlockHorizontalAlignment] Horizontal cell content alignment.
|
9
|
+
# @attr valign [TD::Types::PageBlockVerticalAlignment] Vertical cell content alignment.
|
10
|
+
class PageBlockTableCell < Base
|
11
|
+
attribute :text, TD::Types::RichText
|
12
|
+
attribute :is_header, TD::Types::Bool
|
13
|
+
attribute :colspan, TD::Types::Integer
|
14
|
+
attribute :rowspan, TD::Types::Integer
|
15
|
+
attribute :align, TD::Types::PageBlockHorizontalAlignment
|
16
|
+
attribute :valign, TD::Types::PageBlockVerticalAlignment
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Describes a Vertical alignment of a table cell content.
|
3
|
+
class PageBlockVerticalAlignment < Base
|
4
|
+
%w[
|
5
|
+
top
|
6
|
+
middle
|
7
|
+
bottom
|
8
|
+
].each do |type|
|
9
|
+
autoload TD::Types.camelize(type), "tdlib/types/page_block_vertical_alignment/#{type}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -4,14 +4,10 @@ module TD::Types
|
|
4
4
|
# @attr id [Integer] Unique identifier of the authorization form.
|
5
5
|
# @attr required_elements [Array<TD::Types::PassportRequiredElement>] Information about the Telegram Passport
|
6
6
|
# elements that need to be provided to complete the form.
|
7
|
-
# @attr
|
8
|
-
# @attr errors [Array<TD::Types::PassportElementError>] Errors in the elements that are already available.
|
9
|
-
# @attr privacy_policy_url [String, nil] URL for the privacy policy of the service; can be empty.
|
7
|
+
# @attr privacy_policy_url [String, nil] URL for the privacy policy of the service; may be empty.
|
10
8
|
class PassportAuthorizationForm < Base
|
11
9
|
attribute :id, TD::Types::Integer
|
12
10
|
attribute :required_elements, TD::Types::Array.of(TD::Types::PassportRequiredElement)
|
13
|
-
attribute :elements, TD::Types::Array.of(TD::Types::PassportElement)
|
14
|
-
attribute :errors, TD::Types::Array.of(TD::Types::PassportElementError)
|
15
11
|
attribute :privacy_policy_url, TD::Types::String.optional.default(nil)
|
16
12
|
end
|
17
13
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module TD::Types
|
2
2
|
# The file contains an error.
|
3
3
|
# The error will be considered resolved when the file changes.
|
4
|
+
#
|
5
|
+
# @attr file_index [Integer] Index of a file with the error.
|
4
6
|
class PassportElementErrorSource::File < PassportElementErrorSource
|
7
|
+
attribute :file_index, TD::Types::Integer
|
5
8
|
end
|
6
9
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module TD::Types
|
2
2
|
# One of files with the translation of the document contains an error.
|
3
3
|
# The error will be considered resolved when the file changes.
|
4
|
+
#
|
5
|
+
# @attr file_index [Integer] Index of a file with the error.
|
4
6
|
class PassportElementErrorSource::TranslationFile < PassportElementErrorSource
|
7
|
+
attribute :file_index, TD::Types::Integer
|
5
8
|
end
|
6
9
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains information about a Telegram Passport elements and corresponding errors.
|
3
|
+
#
|
4
|
+
# @attr elements [Array<TD::Types::PassportElement>] Telegram Passport elements.
|
5
|
+
# @attr errors [Array<TD::Types::PassportElementError>] Errors in the elements that are already available.
|
6
|
+
class PassportElementsWithErrors < Base
|
7
|
+
attribute :elements, TD::Types::Array.of(TD::Types::PassportElement)
|
8
|
+
attribute :errors, TD::Types::Array.of(TD::Types::PassportElementError)
|
9
|
+
end
|
10
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
1
|
module TD::Types
|
2
2
|
# Represents the current state of 2-step verification.
|
3
3
|
#
|
4
|
-
# @attr has_password [Boolean] True if a 2-step verification password is set.
|
5
|
-
# @attr password_hint [String, nil] Hint for the password;
|
6
|
-
# @attr has_recovery_email_address [Boolean] True if a recovery email is set.
|
7
|
-
# @attr has_passport_data [Boolean] True if some Telegram Passport elements were saved.
|
8
|
-
# @attr
|
9
|
-
# email was sent.
|
4
|
+
# @attr has_password [Boolean] True, if a 2-step verification password is set.
|
5
|
+
# @attr password_hint [String, nil] Hint for the password; may be empty.
|
6
|
+
# @attr has_recovery_email_address [Boolean] True, if a recovery email is set.
|
7
|
+
# @attr has_passport_data [Boolean] True, if some Telegram Passport elements were saved.
|
8
|
+
# @attr recovery_email_address_code_info [TD::Types::EmailAddressAuthenticationCodeInfo, nil] Information about the
|
9
|
+
# recovery email address to which the confirmation email was sent; may be null.
|
10
10
|
class PasswordState < Base
|
11
11
|
attribute :has_password, TD::Types::Bool
|
12
12
|
attribute :password_hint, TD::Types::String.optional.default(nil)
|
13
13
|
attribute :has_recovery_email_address, TD::Types::Bool
|
14
14
|
attribute :has_passport_data, TD::Types::Bool
|
15
|
-
attribute :
|
15
|
+
attribute :recovery_email_address_code_info, TD::Types::EmailAddressAuthenticationCodeInfo.optional.default(nil)
|
16
16
|
end
|
17
17
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains settings for the authentication of the user's phone number.
|
3
|
+
#
|
4
|
+
# @attr allow_flash_call [Boolean] Pass true if the authentication code may be sent via flash call to the specified
|
5
|
+
# phone number.
|
6
|
+
# @attr is_current_phone_number [Boolean] Pass true if the authenticated phone number is used on the current device.
|
7
|
+
# @attr allow_sms_retriever_api [Boolean] For official applications only.
|
8
|
+
# True, if the app can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically
|
9
|
+
# receive the authentication code from the SMS.
|
10
|
+
# See https://developers.google.com/identity/sms-retriever/ for more details.
|
11
|
+
class PhoneNumberAuthenticationSettings < Base
|
12
|
+
attribute :allow_flash_call, TD::Types::Bool
|
13
|
+
attribute :is_current_phone_number, TD::Types::Bool
|
14
|
+
attribute :allow_sms_retriever_api, TD::Types::Bool
|
15
|
+
end
|
16
|
+
end
|
data/lib/tdlib/types/photo.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module TD::Types
|
2
2
|
# Describes a photo.
|
3
3
|
#
|
4
|
-
# @attr id [Integer] Photo identifier; 0 for deleted photos.
|
5
4
|
# @attr has_stickers [Boolean] True, if stickers were added to the photo.
|
5
|
+
# @attr minithumbnail [TD::Types::Minithumbnail, nil] Photo minithumbnail; may be null.
|
6
6
|
# @attr sizes [Array<TD::Types::PhotoSize>] Available variants of the photo, in different sizes.
|
7
7
|
class Photo < Base
|
8
|
-
attribute :id, TD::Types::Integer
|
9
8
|
attribute :has_stickers, TD::Types::Bool
|
9
|
+
attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil)
|
10
10
|
attribute :sizes, TD::Types::Array.of(TD::Types::PhotoSize)
|
11
11
|
end
|
12
12
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Describes a poll.
|
3
|
+
#
|
4
|
+
# @attr id [Integer] Unique poll identifier.
|
5
|
+
# @attr question [String] Poll question, 1-255 characters.
|
6
|
+
# @attr options [Array<TD::Types::PollOption>] List of poll answer options.
|
7
|
+
# @attr total_voter_count [Integer] Total number of voters, participating in the poll.
|
8
|
+
# @attr is_closed [Boolean] True, if the poll is closed.
|
9
|
+
class Poll < Base
|
10
|
+
attribute :id, TD::Types::Integer
|
11
|
+
attribute :question, TD::Types::String
|
12
|
+
attribute :options, TD::Types::Array.of(TD::Types::PollOption)
|
13
|
+
attribute :total_voter_count, TD::Types::Integer
|
14
|
+
attribute :is_closed, TD::Types::Bool
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Describes one answer option of a poll.
|
3
|
+
#
|
4
|
+
# @attr text [String] Option text, 1-100 characters.
|
5
|
+
# @attr voter_count [Integer] Number of voters for this option, available only for closed or voted polls.
|
6
|
+
# @attr vote_percentage [Integer] The percentage of votes for this option, 0-100.
|
7
|
+
# @attr is_chosen [Boolean] True, if the option was chosen by the user.
|
8
|
+
# @attr is_being_chosen [Boolean] True, if the option is being chosen by a pending setPollAnswer request.
|
9
|
+
class PollOption < Base
|
10
|
+
attribute :text, TD::Types::String
|
11
|
+
attribute :voter_count, TD::Types::Integer
|
12
|
+
attribute :vote_percentage, TD::Types::Integer
|
13
|
+
attribute :is_chosen, TD::Types::Bool
|
14
|
+
attribute :is_being_chosen, TD::Types::Bool
|
15
|
+
end
|
16
|
+
end
|
@@ -4,7 +4,9 @@ module TD::Types
|
|
4
4
|
# @attr id [Integer] Photo identifier; 0 for an empty photo.
|
5
5
|
# Can be used to find a photo in a list of userProfilePhotos.
|
6
6
|
# @attr small [TD::Types::File] A small (160x160) user profile photo.
|
7
|
+
# The file can be downloaded only before the photo is changed.
|
7
8
|
# @attr big [TD::Types::File] A big (640x640) user profile photo.
|
9
|
+
# The file can be downloaded only before the photo is changed.
|
8
10
|
class ProfilePhoto < Base
|
9
11
|
attribute :id, TD::Types::Integer
|
10
12
|
attribute :small, TD::Types::File
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module TD::Types
|
2
|
-
# Contains a public HTTPS link to a message in a public supergroup or channel.
|
2
|
+
# Contains a public HTTPS link to a message in a public supergroup or channel with a username.
|
3
3
|
#
|
4
4
|
# @attr link [String] Message link.
|
5
5
|
# @attr html [String] HTML-code for embedding the message.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains content of a push message notification.
|
3
|
+
class PushMessageContent < Base
|
4
|
+
%w[
|
5
|
+
hidden
|
6
|
+
animation
|
7
|
+
audio
|
8
|
+
contact
|
9
|
+
contact_registered
|
10
|
+
document
|
11
|
+
game
|
12
|
+
game_score
|
13
|
+
invoice
|
14
|
+
location
|
15
|
+
photo
|
16
|
+
poll
|
17
|
+
screenshot_taken
|
18
|
+
sticker
|
19
|
+
text
|
20
|
+
video
|
21
|
+
video_note
|
22
|
+
voice_note
|
23
|
+
basic_group_chat_create
|
24
|
+
chat_add_members
|
25
|
+
chat_change_photo
|
26
|
+
chat_change_title
|
27
|
+
chat_delete_member
|
28
|
+
chat_join_by_link
|
29
|
+
message_forwards
|
30
|
+
media_album
|
31
|
+
].each do |type|
|
32
|
+
autoload TD::Types.camelize(type), "tdlib/types/push_message_content/#{type}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# An animation message (GIF-style)..
|
3
|
+
#
|
4
|
+
# @attr animation [TD::Types::Animation, nil] Message content; may be null.
|
5
|
+
# @attr caption [String] Animation caption.
|
6
|
+
# @attr is_pinned [Boolean] True, if the message is a pinned message with the specified content.
|
7
|
+
class PushMessageContent::Animation < PushMessageContent
|
8
|
+
attribute :animation, TD::Types::Animation.optional.default(nil)
|
9
|
+
attribute :caption, TD::Types::String
|
10
|
+
attribute :is_pinned, TD::Types::Bool
|
11
|
+
end
|
12
|
+
end
|