tdlib-ruby 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains information about the origin of a forwarded message.
|
3
|
+
class MessageForwardOrigin < Base
|
4
|
+
%w[
|
5
|
+
user
|
6
|
+
hidden_user
|
7
|
+
channel
|
8
|
+
].each do |type|
|
9
|
+
autoload TD::Types.camelize(type), "tdlib/types/message_forward_origin/#{type}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# The message was originally a post in a channel.
|
3
|
+
#
|
4
|
+
# @attr chat_id [Integer] Identifier of the chat from which the message was originally forwarded.
|
5
|
+
# @attr message_id [Integer] Message identifier of the original message; 0 if unknown.
|
6
|
+
# @attr author_signature [String] Original post author signature.
|
7
|
+
class MessageForwardOrigin::Channel < MessageForwardOrigin
|
8
|
+
attribute :chat_id, TD::Types::Integer
|
9
|
+
attribute :message_id, TD::Types::Integer
|
10
|
+
attribute :author_signature, TD::Types::String
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# The message was originally written by a user, which is hidden by their privacy settings.
|
3
|
+
#
|
4
|
+
# @attr sender_name [String] Name of the sender.
|
5
|
+
class MessageForwardOrigin::HiddenUser < MessageForwardOrigin
|
6
|
+
attribute :sender_name, TD::Types::String
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# The message was originally written by a known user.
|
3
|
+
#
|
4
|
+
# @attr sender_user_id [Integer] Identifier of the user that originally sent the message.
|
5
|
+
class MessageForwardOrigin::User < MessageForwardOrigin
|
6
|
+
attribute :sender_user_id, TD::Types::Integer
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains information about a link to a message in a chat.
|
3
|
+
#
|
4
|
+
# @attr is_public [Boolean] True, if the link is a public link for a message in a chat.
|
5
|
+
# @attr chat_id [Integer] If found, identifier of the chat to which the message belongs, 0 otherwise.
|
6
|
+
# @attr message [TD::Types::Message, nil] If found, the linked message; may be null.
|
7
|
+
# @attr for_album [Boolean] True, if the whole media album to which the message belongs is linked.
|
8
|
+
class MessageLinkInfo < Base
|
9
|
+
attribute :is_public, TD::Types::Bool
|
10
|
+
attribute :chat_id, TD::Types::Integer
|
11
|
+
attribute :message, TD::Types::Message.optional.default(nil)
|
12
|
+
attribute :for_album, TD::Types::Bool
|
13
|
+
end
|
14
|
+
end
|
@@ -1,5 +1,15 @@
|
|
1
1
|
module TD::Types
|
2
2
|
# The message failed to be sent.
|
3
|
+
#
|
4
|
+
# @attr error_code [Integer] An error code; 0 if unknown.
|
5
|
+
# @attr error_message [String] Error message.
|
6
|
+
# @attr can_retry [Boolean] True, if the message can be re-sent.
|
7
|
+
# @attr retry_after [Float] Time left before the message can be re-sent, in seconds.
|
8
|
+
# No update is sent when this field changes.
|
3
9
|
class MessageSendingState::Failed < MessageSendingState
|
10
|
+
attribute :error_code, TD::Types::Integer
|
11
|
+
attribute :error_message, TD::Types::String
|
12
|
+
attribute :can_retry, TD::Types::Bool
|
13
|
+
attribute :retry_after, TD::Types::Float
|
4
14
|
end
|
5
15
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Thumbnail image of a very poor quality and low resolution.
|
3
|
+
#
|
4
|
+
# @attr width [Integer] Thumbnail width, usually doesn't exceed 40.
|
5
|
+
# @attr height [Integer] Thumbnail height, usually doesn't exceed 40.
|
6
|
+
# @attr data [String] The thumbnail in JPEG format.
|
7
|
+
class Minithumbnail < Base
|
8
|
+
attribute :width, TD::Types::Integer
|
9
|
+
attribute :height, TD::Types::Integer
|
10
|
+
attribute :data, TD::Types::String
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains information about a notification.
|
3
|
+
#
|
4
|
+
# @attr id [Integer] Unique persistent identifier of this notification.
|
5
|
+
# @attr date [Integer] Notification date.
|
6
|
+
# @attr type [TD::Types::NotificationType] Notification type.
|
7
|
+
class Notification < Base
|
8
|
+
attribute :id, TD::Types::Integer
|
9
|
+
attribute :date, TD::Types::Integer
|
10
|
+
attribute :type, TD::Types::NotificationType
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Describes a group of notifications.
|
3
|
+
#
|
4
|
+
# @attr id [Integer] Unique persistent auto-incremented from 1 identifier of the notification group.
|
5
|
+
# @attr type [TD::Types::NotificationGroupType] Type of the group.
|
6
|
+
# @attr chat_id [Integer] Identifier of a chat to which all notifications in the group belong.
|
7
|
+
# @attr total_count [Integer] Total number of active notifications in the group.
|
8
|
+
# @attr notifications [Array<TD::Types::Notification>] The list of active notifications.
|
9
|
+
class NotificationGroup < Base
|
10
|
+
attribute :id, TD::Types::Integer
|
11
|
+
attribute :type, TD::Types::NotificationGroupType
|
12
|
+
attribute :chat_id, TD::Types::Integer
|
13
|
+
attribute :total_count, TD::Types::Integer
|
14
|
+
attribute :notifications, TD::Types::Array.of(TD::Types::Notification)
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Describes type of notifications in the group.
|
3
|
+
class NotificationGroupType < Base
|
4
|
+
%w[
|
5
|
+
messages
|
6
|
+
mentions
|
7
|
+
secret_chat
|
8
|
+
calls
|
9
|
+
].each do |type|
|
10
|
+
autoload TD::Types.camelize(type), "tdlib/types/notification_group_type/#{type}"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread
|
3
|
+
# mentions of the current user, replies to their messages, or a pinned message.
|
4
|
+
class NotificationGroupType::Mentions < NotificationGroupType
|
5
|
+
end
|
6
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module TD::Types
|
2
|
-
# Notification settings applied to all basic groups
|
3
|
-
#
|
2
|
+
# Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default
|
3
|
+
# value.
|
4
4
|
class NotificationSettingsScope::GroupChats < NotificationSettingsScope
|
5
5
|
end
|
6
6
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# Contains detailed information about a notification.
|
3
|
+
class NotificationType < Base
|
4
|
+
%w[
|
5
|
+
new_message
|
6
|
+
new_secret_chat
|
7
|
+
new_call
|
8
|
+
new_push_message
|
9
|
+
].each do |type|
|
10
|
+
autoload TD::Types.camelize(type), "tdlib/types/notification_type/#{type}"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# New message was received through a push notification.
|
3
|
+
#
|
4
|
+
# @attr message_id [Integer] The message identifier.
|
5
|
+
# The message will not be available in the chat history, but the ID can be used in viewMessages and as
|
6
|
+
# reply_to_message_id.
|
7
|
+
# @attr sender_user_id [Integer] Sender of the message.
|
8
|
+
# Corresponding user may be inaccessible.
|
9
|
+
# @attr content [TD::Types::PushMessageContent] Push message content.
|
10
|
+
class NotificationType::NewPushMessage < NotificationType
|
11
|
+
attribute :message_id, TD::Types::Integer
|
12
|
+
attribute :sender_user_id, TD::Types::Integer
|
13
|
+
attribute :content, TD::Types::PushMessageContent
|
14
|
+
end
|
15
|
+
end
|
@@ -7,6 +7,7 @@ module TD::Types
|
|
7
7
|
author_date
|
8
8
|
header
|
9
9
|
subheader
|
10
|
+
kicker
|
10
11
|
paragraph
|
11
12
|
preformatted
|
12
13
|
footer
|
@@ -25,6 +26,10 @@ module TD::Types
|
|
25
26
|
collage
|
26
27
|
slideshow
|
27
28
|
chat_link
|
29
|
+
table
|
30
|
+
details
|
31
|
+
related_articles
|
32
|
+
map
|
28
33
|
].each do |type|
|
29
34
|
autoload TD::Types.camelize(type), "tdlib/types/page_block/#{type}"
|
30
35
|
end
|
@@ -2,11 +2,11 @@ module TD::Types
|
|
2
2
|
# An animation.
|
3
3
|
#
|
4
4
|
# @attr animation [TD::Types::Animation, nil] Animation file; may be null.
|
5
|
-
# @attr caption [TD::Types::
|
5
|
+
# @attr caption [TD::Types::PageBlockCaption] Animation caption.
|
6
6
|
# @attr need_autoplay [Boolean] True, if the animation should be played automatically.
|
7
7
|
class PageBlock::Animation < PageBlock
|
8
8
|
attribute :animation, TD::Types::Animation.optional.default(nil)
|
9
|
-
attribute :caption, TD::Types::
|
9
|
+
attribute :caption, TD::Types::PageBlockCaption
|
10
10
|
attribute :need_autoplay, TD::Types::Bool
|
11
11
|
end
|
12
12
|
end
|
@@ -2,9 +2,9 @@ module TD::Types
|
|
2
2
|
# An audio file.
|
3
3
|
#
|
4
4
|
# @attr audio [TD::Types::Audio, nil] Audio file; may be null.
|
5
|
-
# @attr caption [TD::Types::
|
5
|
+
# @attr caption [TD::Types::PageBlockCaption] Audio file caption.
|
6
6
|
class PageBlock::Audio < PageBlock
|
7
7
|
attribute :audio, TD::Types::Audio.optional.default(nil)
|
8
|
-
attribute :caption, TD::Types::
|
8
|
+
attribute :caption, TD::Types::PageBlockCaption
|
9
9
|
end
|
10
10
|
end
|
@@ -2,9 +2,9 @@ module TD::Types
|
|
2
2
|
# A block 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::BlockQuote < PageBlock
|
7
7
|
attribute :text, TD::Types::RichText
|
8
|
-
attribute :
|
8
|
+
attribute :credit, TD::Types::RichText
|
9
9
|
end
|
10
10
|
end
|
@@ -2,9 +2,9 @@ module TD::Types
|
|
2
2
|
# A collage.
|
3
3
|
#
|
4
4
|
# @attr page_blocks [Array<TD::Types::PageBlock>] Collage item contents.
|
5
|
-
# @attr caption [TD::Types::
|
5
|
+
# @attr caption [TD::Types::PageBlockCaption] Block caption.
|
6
6
|
class PageBlock::Collage < 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,12 @@
|
|
1
|
+
module TD::Types
|
2
|
+
# A collapsible block.
|
3
|
+
#
|
4
|
+
# @attr header [TD::Types::RichText] Always visible heading for the block.
|
5
|
+
# @attr page_blocks [Array<TD::Types::PageBlock>] Block contents.
|
6
|
+
# @attr is_open [Boolean] True, if the block is open by default.
|
7
|
+
class PageBlock::Details < PageBlock
|
8
|
+
attribute :header, TD::Types::RichText
|
9
|
+
attribute :page_blocks, TD::Types::Array.of(TD::Types::PageBlock)
|
10
|
+
attribute :is_open, TD::Types::Bool
|
11
|
+
end
|
12
|
+
end
|
@@ -4,9 +4,9 @@ module TD::Types
|
|
4
4
|
# @attr url [String, nil] Web page URL, if available.
|
5
5
|
# @attr html [String] HTML-markup of the embedded page.
|
6
6
|
# @attr poster_photo [TD::Types::Photo, nil] Poster photo, if available; may be null.
|
7
|
-
# @attr width [Integer] Block width.
|
8
|
-
# @attr height [Integer] Block height.
|
9
|
-
# @attr caption [TD::Types::
|
7
|
+
# @attr width [Integer] Block width; 0 if unknown.
|
8
|
+
# @attr height [Integer] Block height; 0 if unknown.
|
9
|
+
# @attr caption [TD::Types::PageBlockCaption] Block caption.
|
10
10
|
# @attr is_full_width [Boolean] True, if the block should be full width.
|
11
11
|
# @attr allow_scrolling [Boolean] True, if scrolling should be allowed.
|
12
12
|
class PageBlock::Embedded < PageBlock
|
@@ -15,7 +15,7 @@ module TD::Types
|
|
15
15
|
attribute :poster_photo, TD::Types::Photo.optional.default(nil)
|
16
16
|
attribute :width, TD::Types::Integer
|
17
17
|
attribute :height, TD::Types::Integer
|
18
|
-
attribute :caption, TD::Types::
|
18
|
+
attribute :caption, TD::Types::PageBlockCaption
|
19
19
|
attribute :is_full_width, TD::Types::Bool
|
20
20
|
attribute :allow_scrolling, TD::Types::Bool
|
21
21
|
end
|
@@ -3,16 +3,16 @@ module TD::Types
|
|
3
3
|
#
|
4
4
|
# @attr url [String] Web page URL.
|
5
5
|
# @attr author [String] Post author.
|
6
|
-
# @attr author_photo [TD::Types::Photo] Post author photo.
|
6
|
+
# @attr author_photo [TD::Types::Photo, nil] Post author photo; may be null.
|
7
7
|
# @attr date [Integer] Point in time (Unix timestamp) when the post was created; 0 if unknown.
|
8
8
|
# @attr page_blocks [Array<TD::Types::PageBlock>] Post content.
|
9
|
-
# @attr caption [TD::Types::
|
9
|
+
# @attr caption [TD::Types::PageBlockCaption] Post caption.
|
10
10
|
class PageBlock::EmbeddedPost < PageBlock
|
11
11
|
attribute :url, TD::Types::String
|
12
12
|
attribute :author, TD::Types::String
|
13
|
-
attribute :author_photo, TD::Types::Photo
|
13
|
+
attribute :author_photo, TD::Types::Photo.optional.default(nil)
|
14
14
|
attribute :date, TD::Types::Integer
|
15
15
|
attribute :page_blocks, TD::Types::Array.of(TD::Types::PageBlock)
|
16
|
-
attribute :caption, TD::Types::
|
16
|
+
attribute :caption, TD::Types::PageBlockCaption
|
17
17
|
end
|
18
18
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module TD::Types
|
2
|
-
# A list of
|
2
|
+
# A list of data blocks.
|
3
3
|
#
|
4
|
-
# @attr items [Array<TD::Types::
|
5
|
-
# @attr is_ordered [Boolean] True, if the items should be marked with numbers.
|
4
|
+
# @attr items [Array<TD::Types::PageBlockListItem>] The items of the list.
|
6
5
|
class PageBlock::List < PageBlock
|
7
|
-
attribute :items, TD::Types::Array.of(TD::Types::
|
8
|
-
attribute :is_ordered, TD::Types::Bool
|
6
|
+
attribute :items, TD::Types::Array.of(TD::Types::PageBlockListItem)
|
9
7
|
end
|
10
8
|
end
|