telegram-bot-ruby 0.23.0 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.sample +2 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +2 -1
- data/README.md +25 -13
- data/Rakefile +43 -0
- data/lib/telegram/bot/api.rb +3 -1
- data/lib/telegram/bot/types/animation.rb +9 -9
- data/lib/telegram/bot/types/audio.rb +9 -9
- data/lib/telegram/bot/types/base.rb +3 -2
- data/lib/telegram/bot/types/bot_command.rb +2 -2
- data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +1 -1
- data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +1 -1
- data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +1 -1
- data/lib/telegram/bot/types/bot_command_scope_chat.rb +2 -2
- data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +2 -2
- data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +3 -3
- data/lib/telegram/bot/types/bot_command_scope_default.rb +1 -1
- data/lib/telegram/bot/types/callback_query.rb +6 -6
- data/lib/telegram/bot/types/chat.rb +29 -28
- data/lib/telegram/bot/types/chat_administrator_rights.rb +13 -12
- data/lib/telegram/bot/types/chat_invite_link.rb +8 -8
- data/lib/telegram/bot/types/chat_join_request.rb +3 -3
- data/lib/telegram/bot/types/chat_location.rb +1 -1
- data/lib/telegram/bot/types/chat_member.rb +0 -22
- data/lib/telegram/bot/types/chat_member_administrator.rb +26 -0
- data/lib/telegram/bot/types/chat_member_banned.rb +13 -0
- data/lib/telegram/bot/types/chat_member_left.rb +12 -0
- data/lib/telegram/bot/types/chat_member_member.rb +12 -0
- data/lib/telegram/bot/types/chat_member_owner.rb +14 -0
- data/lib/telegram/bot/types/chat_member_restricted.rb +23 -0
- data/lib/telegram/bot/types/chat_member_updated.rb +2 -2
- data/lib/telegram/bot/types/chat_permissions.rb +9 -8
- data/lib/telegram/bot/types/chat_photo.rb +4 -4
- data/lib/telegram/bot/types/chosen_inline_result.rb +4 -4
- data/lib/telegram/bot/types/contact.rb +5 -5
- data/lib/telegram/bot/types/dice.rb +2 -2
- data/lib/telegram/bot/types/document.rb +6 -6
- data/lib/telegram/bot/types/encrypted_credentials.rb +3 -3
- data/lib/telegram/bot/types/encrypted_passport_element.rb +10 -10
- data/lib/telegram/bot/types/file.rb +4 -4
- data/lib/telegram/bot/types/force_reply.rb +3 -3
- data/lib/telegram/bot/types/forum_topic.rb +14 -0
- data/lib/telegram/bot/types/forum_topic_closed.rb +10 -0
- data/lib/telegram/bot/types/forum_topic_created.rb +13 -0
- data/lib/telegram/bot/types/forum_topic_edited.rb +12 -0
- data/lib/telegram/bot/types/forum_topic_reopened.rb +10 -0
- data/lib/telegram/bot/types/game.rb +6 -6
- data/lib/telegram/bot/types/game_high_score.rb +2 -2
- data/lib/telegram/bot/types/general_forum_topic_hidden.rb +10 -0
- data/lib/telegram/bot/types/general_forum_topic_unhidden.rb +10 -0
- data/lib/telegram/bot/types/inline_keyboard_button.rb +9 -9
- data/lib/telegram/bot/types/inline_keyboard_markup.rb +1 -1
- data/lib/telegram/bot/types/inline_query.rb +5 -5
- data/lib/telegram/bot/types/inline_query_result_article.rb +10 -10
- data/lib/telegram/bot/types/inline_query_result_audio.rb +11 -10
- data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +8 -7
- data/lib/telegram/bot/types/inline_query_result_cached_document.rb +10 -9
- data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +9 -8
- data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +9 -8
- data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +10 -9
- data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +5 -5
- data/lib/telegram/bot/types/inline_query_result_cached_video.rb +10 -9
- data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +9 -8
- data/lib/telegram/bot/types/inline_query_result_contact.rb +11 -11
- data/lib/telegram/bot/types/inline_query_result_document.rb +14 -13
- data/lib/telegram/bot/types/inline_query_result_game.rb +4 -4
- data/lib/telegram/bot/types/inline_query_result_gif.rb +14 -12
- data/lib/telegram/bot/types/inline_query_result_location.rb +14 -14
- data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +14 -13
- data/lib/telegram/bot/types/inline_query_result_photo.rb +13 -12
- data/lib/telegram/bot/types/inline_query_result_venue.rb +15 -15
- data/lib/telegram/bot/types/inline_query_result_video.rb +15 -14
- data/lib/telegram/bot/types/inline_query_result_voice.rb +10 -9
- data/lib/telegram/bot/types/input_contact_message_content.rb +4 -4
- data/lib/telegram/bot/types/input_invoice_message_content.rb +20 -20
- data/lib/telegram/bot/types/input_location_message_content.rb +6 -6
- data/lib/telegram/bot/types/input_media_animation.rb +10 -8
- data/lib/telegram/bot/types/input_media_audio.rb +9 -8
- data/lib/telegram/bot/types/input_media_document.rb +7 -7
- data/lib/telegram/bot/types/input_media_photo.rb +6 -4
- data/lib/telegram/bot/types/input_media_video.rb +11 -8
- data/lib/telegram/bot/types/input_text_message_content.rb +4 -3
- data/lib/telegram/bot/types/input_venue_message_content.rb +8 -8
- data/lib/telegram/bot/types/invoice.rb +5 -5
- data/lib/telegram/bot/types/keyboard_button.rb +5 -5
- data/lib/telegram/bot/types/keyboard_button_poll_type.rb +1 -1
- data/lib/telegram/bot/types/labeled_price.rb +2 -2
- data/lib/telegram/bot/types/location.rb +6 -6
- data/lib/telegram/bot/types/login_url.rb +4 -4
- data/lib/telegram/bot/types/mask_position.rb +4 -4
- data/lib/telegram/bot/types/menu_button_commands.rb +1 -1
- data/lib/telegram/bot/types/menu_button_default.rb +1 -1
- data/lib/telegram/bot/types/menu_button_web_app.rb +2 -2
- data/lib/telegram/bot/types/message.rb +68 -58
- data/lib/telegram/bot/types/message_auto_delete_timer_changed.rb +1 -1
- data/lib/telegram/bot/types/message_entity.rb +7 -7
- data/lib/telegram/bot/types/order_info.rb +4 -4
- data/lib/telegram/bot/types/passport_data.rb +1 -1
- data/lib/telegram/bot/types/passport_element_error_data_field.rb +5 -5
- data/lib/telegram/bot/types/passport_element_error_file.rb +4 -4
- data/lib/telegram/bot/types/passport_element_error_files.rb +4 -4
- data/lib/telegram/bot/types/passport_element_error_front_side.rb +4 -4
- data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +4 -4
- data/lib/telegram/bot/types/passport_element_error_selfie.rb +4 -4
- data/lib/telegram/bot/types/passport_element_error_translation_file.rb +4 -4
- data/lib/telegram/bot/types/passport_element_error_translation_files.rb +4 -4
- data/lib/telegram/bot/types/passport_element_error_unspecified.rb +4 -4
- data/lib/telegram/bot/types/passport_file.rb +4 -4
- data/lib/telegram/bot/types/photo_size.rb +5 -5
- data/lib/telegram/bot/types/poll.rb +13 -13
- data/lib/telegram/bot/types/poll_answer.rb +2 -2
- data/lib/telegram/bot/types/poll_option.rb +2 -2
- data/lib/telegram/bot/types/pre_checkout_query.rb +6 -6
- data/lib/telegram/bot/types/proximity_alert_triggered.rb +1 -1
- data/lib/telegram/bot/types/reply_keyboard_markup.rb +6 -5
- data/lib/telegram/bot/types/reply_keyboard_remove.rb +2 -2
- data/lib/telegram/bot/types/sent_web_app_message.rb +1 -1
- data/lib/telegram/bot/types/shipping_address.rb +6 -6
- data/lib/telegram/bot/types/shipping_option.rb +3 -3
- data/lib/telegram/bot/types/shipping_query.rb +2 -2
- data/lib/telegram/bot/types/sticker.rb +14 -14
- data/lib/telegram/bot/types/sticker_set.rb +7 -8
- data/lib/telegram/bot/types/successful_payment.rb +7 -7
- data/lib/telegram/bot/types/update.rb +15 -15
- data/lib/telegram/bot/types/user.rb +11 -11
- data/lib/telegram/bot/types/user_profile_photos.rb +2 -2
- data/lib/telegram/bot/types/venue.rb +6 -6
- data/lib/telegram/bot/types/video.rb +9 -9
- data/lib/telegram/bot/types/video_chat_ended.rb +1 -1
- data/lib/telegram/bot/types/video_chat_participants_invited.rb +1 -1
- data/lib/telegram/bot/types/video_chat_scheduled.rb +1 -1
- data/lib/telegram/bot/types/video_note.rb +6 -6
- data/lib/telegram/bot/types/voice.rb +5 -5
- data/lib/telegram/bot/types/web_app_data.rb +2 -2
- data/lib/telegram/bot/types/web_app_info.rb +1 -1
- data/lib/telegram/bot/types/webhook_info.rb +9 -9
- data/lib/telegram/bot/types/write_access_allowed.rb +10 -0
- data/lib/telegram/bot/types.rb +7 -124
- data/lib/telegram/bot/version.rb +1 -1
- data/lib/telegram/bot.rb +7 -9
- data/telegram-bot-ruby.gemspec +4 -2
- metadata +56 -14
- data/lib/telegram/bot/exceptions.rb +0 -4
@@ -4,12 +4,12 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class Location < Base
|
7
|
-
attribute :longitude, Float
|
8
|
-
attribute :latitude, Float
|
9
|
-
attribute :horizontal_accuracy, Float
|
10
|
-
attribute :live_period, Integer
|
11
|
-
attribute :heading, Integer
|
12
|
-
attribute :proximity_alert_radius, Integer
|
7
|
+
attribute :longitude, Types::Float
|
8
|
+
attribute :latitude, Types::Float
|
9
|
+
attribute? :horizontal_accuracy, Types::Float
|
10
|
+
attribute? :live_period, Types::Integer
|
11
|
+
attribute? :heading, Types::Integer
|
12
|
+
attribute? :proximity_alert_radius, Types::Integer
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class LoginUrl < Base
|
7
|
-
attribute :url, String
|
8
|
-
attribute :forward_text, String
|
9
|
-
attribute :bot_username, String
|
10
|
-
attribute :request_write_access,
|
7
|
+
attribute :url, Types::String
|
8
|
+
attribute? :forward_text, Types::String
|
9
|
+
attribute? :bot_username, Types::String
|
10
|
+
attribute? :request_write_access, Types::Bool
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class MaskPosition < Base
|
7
|
-
attribute :point, String
|
8
|
-
attribute :x_shift, Float
|
9
|
-
attribute :y_shift, Float
|
10
|
-
attribute :
|
7
|
+
attribute :point, Types::String
|
8
|
+
attribute :x_shift, Types::Float
|
9
|
+
attribute :y_shift, Types::Float
|
10
|
+
attribute :scale, Types::Float
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,8 +4,8 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class MenuButtonWebApp < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :text, String
|
7
|
+
attribute :type, Types::String.default('web_app')
|
8
|
+
attribute :text, Types::String
|
9
9
|
attribute :web_app, WebAppInfo
|
10
10
|
end
|
11
11
|
end
|
@@ -4,65 +4,75 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class Message < Base
|
7
|
-
attribute :message_id, Integer
|
8
|
-
attribute :
|
9
|
-
attribute :
|
10
|
-
attribute :
|
7
|
+
attribute :message_id, Types::Integer
|
8
|
+
attribute? :message_thread_id, Types::Integer
|
9
|
+
attribute? :from, User
|
10
|
+
attribute? :sender_chat, Chat
|
11
|
+
attribute :date, Types::Integer
|
11
12
|
attribute :chat, Chat
|
12
|
-
attribute :forward_from, User
|
13
|
-
attribute :forward_from_chat, Chat
|
14
|
-
attribute :forward_from_message_id, Integer
|
15
|
-
attribute :forward_signature, String
|
16
|
-
attribute :forward_sender_name, String
|
17
|
-
attribute :forward_date, Integer
|
18
|
-
attribute :
|
19
|
-
attribute :
|
20
|
-
attribute :
|
21
|
-
attribute :
|
22
|
-
attribute :
|
23
|
-
attribute :
|
24
|
-
attribute :
|
25
|
-
attribute :
|
26
|
-
attribute :
|
27
|
-
attribute :
|
28
|
-
attribute :
|
29
|
-
attribute :
|
30
|
-
attribute :
|
31
|
-
attribute :
|
32
|
-
attribute :
|
33
|
-
attribute :
|
34
|
-
attribute :
|
35
|
-
attribute :
|
36
|
-
attribute :
|
37
|
-
attribute :
|
38
|
-
attribute :
|
39
|
-
attribute :
|
40
|
-
attribute :
|
41
|
-
attribute :
|
42
|
-
attribute :
|
43
|
-
attribute :
|
44
|
-
attribute :
|
45
|
-
attribute :
|
46
|
-
attribute :
|
47
|
-
attribute :
|
48
|
-
attribute :
|
49
|
-
attribute :
|
50
|
-
attribute :
|
51
|
-
attribute :
|
52
|
-
attribute :
|
53
|
-
attribute :
|
54
|
-
attribute :
|
55
|
-
attribute :
|
56
|
-
attribute :
|
57
|
-
attribute :
|
58
|
-
attribute :
|
59
|
-
attribute :
|
60
|
-
attribute :
|
61
|
-
attribute :
|
62
|
-
attribute :
|
63
|
-
attribute :
|
64
|
-
attribute :
|
65
|
-
attribute :
|
13
|
+
attribute? :forward_from, User
|
14
|
+
attribute? :forward_from_chat, Chat
|
15
|
+
attribute? :forward_from_message_id, Types::Integer
|
16
|
+
attribute? :forward_signature, Types::String
|
17
|
+
attribute? :forward_sender_name, Types::String
|
18
|
+
attribute? :forward_date, Types::Integer
|
19
|
+
attribute? :is_topic_message, Types::Bool
|
20
|
+
attribute? :is_automatic_forward, Types::Bool
|
21
|
+
attribute? :reply_to_message, Message
|
22
|
+
attribute? :via_bot, User
|
23
|
+
attribute? :edit_date, Types::Integer
|
24
|
+
attribute? :has_protected_content, Types::Bool
|
25
|
+
attribute? :media_group_id, Types::String
|
26
|
+
attribute? :author_signature, Types::String
|
27
|
+
attribute? :text, Types::String
|
28
|
+
attribute? :entities, Types::Array.of(MessageEntity)
|
29
|
+
attribute? :animation, Animation
|
30
|
+
attribute? :audio, Audio
|
31
|
+
attribute? :document, Document
|
32
|
+
attribute? :photo, Types::Array.of(PhotoSize)
|
33
|
+
attribute? :sticker, Sticker
|
34
|
+
attribute? :video, Video
|
35
|
+
attribute? :video_note, VideoNote
|
36
|
+
attribute? :voice, Voice
|
37
|
+
attribute? :caption, Types::String
|
38
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
39
|
+
attribute? :has_media_spoiler, Types::Bool
|
40
|
+
attribute? :contact, Contact
|
41
|
+
attribute? :dice, Dice
|
42
|
+
attribute? :game, Game
|
43
|
+
attribute? :poll, Poll
|
44
|
+
attribute? :venue, Venue
|
45
|
+
attribute? :location, Location
|
46
|
+
attribute? :new_chat_members, Types::Array.of(User)
|
47
|
+
attribute? :left_chat_member, User
|
48
|
+
attribute? :new_chat_title, Types::String
|
49
|
+
attribute? :new_chat_photo, Types::Array.of(PhotoSize)
|
50
|
+
attribute? :delete_chat_photo, Types::Bool
|
51
|
+
attribute? :group_chat_created, Types::Bool
|
52
|
+
attribute? :supergroup_chat_created, Types::Bool
|
53
|
+
attribute? :channel_chat_created, Types::Bool
|
54
|
+
attribute? :message_auto_delete_timer_changed, MessageAutoDeleteTimerChanged
|
55
|
+
attribute? :migrate_to_chat_id, Types::Integer
|
56
|
+
attribute? :migrate_from_chat_id, Types::Integer
|
57
|
+
attribute? :pinned_message, Message
|
58
|
+
attribute? :invoice, Invoice
|
59
|
+
attribute? :successful_payment, SuccessfulPayment
|
60
|
+
attribute? :connected_website, Types::String
|
61
|
+
attribute? :write_access_allowed, WriteAccessAllowed
|
62
|
+
attribute? :passport_data, PassportData
|
63
|
+
attribute? :proximity_alert_triggered, ProximityAlertTriggered
|
64
|
+
attribute? :forum_topic_created, ForumTopicCreated
|
65
|
+
attribute? :forum_topic_edited, ForumTopicEdited
|
66
|
+
attribute? :forum_topic_closed, ForumTopicClosed
|
67
|
+
attribute? :forum_topic_reopened, ForumTopicReopened
|
68
|
+
attribute? :general_forum_topic_hidden, GeneralForumTopicHidden
|
69
|
+
attribute? :general_forum_topic_unhidden, GeneralForumTopicUnhidden
|
70
|
+
attribute? :video_chat_scheduled, VideoChatScheduled
|
71
|
+
attribute? :video_chat_started, VideoChatStarted
|
72
|
+
attribute? :video_chat_ended, VideoChatEnded
|
73
|
+
attribute? :video_chat_participants_invited, VideoChatParticipantsInvited
|
74
|
+
attribute? :web_app_data, WebAppData
|
75
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
66
76
|
|
67
77
|
alias to_s text
|
68
78
|
end
|
@@ -4,13 +4,13 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class MessageEntity < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :offset, Integer
|
9
|
-
attribute :length, Integer
|
10
|
-
attribute :url, String
|
11
|
-
attribute :user, User
|
12
|
-
attribute :language, String
|
13
|
-
attribute :custom_emoji_id, String
|
7
|
+
attribute :type, Types::String
|
8
|
+
attribute :offset, Types::Integer
|
9
|
+
attribute :length, Types::Integer
|
10
|
+
attribute? :url, Types::String
|
11
|
+
attribute? :user, User
|
12
|
+
attribute? :language, Types::String
|
13
|
+
attribute? :custom_emoji_id, Types::String
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class OrderInfo < Base
|
7
|
-
attribute :name, String
|
8
|
-
attribute :phone_number, String
|
9
|
-
attribute :email, String
|
10
|
-
attribute :shipping_address, ShippingAddress
|
7
|
+
attribute? :name, Types::String
|
8
|
+
attribute? :phone_number, Types::String
|
9
|
+
attribute? :email, Types::String
|
10
|
+
attribute? :shipping_address, ShippingAddress
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,11 +4,11 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorDataField < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :field_name, String
|
10
|
-
attribute :data_hash, String
|
11
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('data')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :field_name, Types::String
|
10
|
+
attribute :data_hash, Types::String
|
11
|
+
attribute :message, Types::String
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorFile < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :file_hash, String
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('file')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :file_hash, Types::String
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorFiles < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :file_hashes, Array
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('files')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :file_hashes, Types::Array.of(String)
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorFrontSide < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :file_hash, String
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('front_side')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :file_hash, Types::String
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorReverseSide < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :file_hash, String
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('reverse_side')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :file_hash, Types::String
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorSelfie < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :file_hash, String
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('selfie')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :file_hash, Types::String
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorTranslationFile < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :file_hash, String
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('translation_file')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :file_hash, Types::String
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorTranslationFiles < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :file_hashes, Array
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('translation_files')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :file_hashes, Types::Array.of(String)
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportElementErrorUnspecified < Base
|
7
|
-
attribute :source, String
|
8
|
-
attribute :type, String
|
9
|
-
attribute :element_hash, String
|
10
|
-
attribute :message, String
|
7
|
+
attribute :source, Types::String.default('unspecified')
|
8
|
+
attribute :type, Types::String
|
9
|
+
attribute :element_hash, Types::String
|
10
|
+
attribute :message, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PassportFile < Base
|
7
|
-
attribute :file_id, String
|
8
|
-
attribute :file_unique_id, String
|
9
|
-
attribute :file_size, Integer
|
10
|
-
attribute :file_date, Integer
|
7
|
+
attribute :file_id, Types::String
|
8
|
+
attribute :file_unique_id, Types::String
|
9
|
+
attribute :file_size, Types::Integer
|
10
|
+
attribute :file_date, Types::Integer
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,11 +4,11 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PhotoSize < Base
|
7
|
-
attribute :file_id, String
|
8
|
-
attribute :file_unique_id, String
|
9
|
-
attribute :width, Integer
|
10
|
-
attribute :height, Integer
|
11
|
-
attribute :file_size, Integer
|
7
|
+
attribute :file_id, Types::String
|
8
|
+
attribute :file_unique_id, Types::String
|
9
|
+
attribute :width, Types::Integer
|
10
|
+
attribute :height, Types::Integer
|
11
|
+
attribute? :file_size, Types::Integer
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -4,19 +4,19 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class Poll < Base
|
7
|
-
attribute :id, String
|
8
|
-
attribute :question, String
|
9
|
-
attribute :options, Array
|
10
|
-
attribute :total_voter_count, Integer
|
11
|
-
attribute :is_closed,
|
12
|
-
attribute :is_anonymous,
|
13
|
-
attribute :type, String
|
14
|
-
attribute :allows_multiple_answers,
|
15
|
-
attribute :correct_option_id, Integer
|
16
|
-
attribute :explanation, String
|
17
|
-
attribute :explanation_entities, Array
|
18
|
-
attribute :open_period, Integer
|
19
|
-
attribute :close_date, Integer
|
7
|
+
attribute :id, Types::String
|
8
|
+
attribute :question, Types::String
|
9
|
+
attribute :options, Types::Array.of(PollOption)
|
10
|
+
attribute :total_voter_count, Types::Integer
|
11
|
+
attribute :is_closed, Types::Bool
|
12
|
+
attribute :is_anonymous, Types::Bool
|
13
|
+
attribute :type, Types::String
|
14
|
+
attribute :allows_multiple_answers, Types::Bool
|
15
|
+
attribute? :correct_option_id, Types::Integer
|
16
|
+
attribute? :explanation, Types::String
|
17
|
+
attribute? :explanation_entities, Types::Array.of(MessageEntity)
|
18
|
+
attribute? :open_period, Types::Integer
|
19
|
+
attribute? :close_date, Types::Integer
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -4,9 +4,9 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PollAnswer < Base
|
7
|
-
attribute :poll_id, String
|
7
|
+
attribute :poll_id, Types::String
|
8
8
|
attribute :user, User
|
9
|
-
attribute :option_ids, Array
|
9
|
+
attribute :option_ids, Types::Array.of(Types::Integer)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -4,13 +4,13 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class PreCheckoutQuery < Base
|
7
|
-
attribute :id, String
|
7
|
+
attribute :id, Types::String
|
8
8
|
attribute :from, User
|
9
|
-
attribute :currency, String
|
10
|
-
attribute :total_amount, Integer
|
11
|
-
attribute :invoice_payload, String
|
12
|
-
attribute :shipping_option_id, String
|
13
|
-
attribute :order_info, OrderInfo
|
9
|
+
attribute :currency, Types::String
|
10
|
+
attribute :total_amount, Types::Integer
|
11
|
+
attribute :invoice_payload, Types::String
|
12
|
+
attribute? :shipping_option_id, Types::String
|
13
|
+
attribute? :order_info, OrderInfo
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -4,11 +4,12 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class ReplyKeyboardMarkup < Base
|
7
|
-
attribute :keyboard, Array
|
8
|
-
attribute :
|
9
|
-
attribute :
|
10
|
-
attribute :
|
11
|
-
attribute :
|
7
|
+
attribute :keyboard, Types::Array.of(Types::Array.of(KeyboardButton))
|
8
|
+
attribute? :is_persistent, Types::Bool.default(false)
|
9
|
+
attribute? :resize_keyboard, Types::Bool.default(false)
|
10
|
+
attribute? :one_time_keyboard, Types::Bool.default(false)
|
11
|
+
attribute? :input_field_placeholder, Types::String
|
12
|
+
attribute? :selective, Types::Bool.default(false)
|
12
13
|
|
13
14
|
def to_compact_hash
|
14
15
|
hsh = super
|
@@ -4,8 +4,8 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class ReplyKeyboardRemove < Base
|
7
|
-
attribute :remove_keyboard,
|
8
|
-
attribute :selective,
|
7
|
+
attribute :remove_keyboard, Types::Bool
|
8
|
+
attribute? :selective, Types::Bool.default(false)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -4,12 +4,12 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class ShippingAddress < Base
|
7
|
-
attribute :country_code, String
|
8
|
-
attribute :state, String
|
9
|
-
attribute :city, String
|
10
|
-
attribute :street_line1, String
|
11
|
-
attribute :street_line2, String
|
12
|
-
attribute :post_code, String
|
7
|
+
attribute :country_code, Types::String
|
8
|
+
attribute :state, Types::String
|
9
|
+
attribute :city, Types::String
|
10
|
+
attribute :street_line1, Types::String
|
11
|
+
attribute :street_line2, Types::String
|
12
|
+
attribute :post_code, Types::String
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -4,9 +4,9 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class ShippingOption < Base
|
7
|
-
attribute :id, String
|
8
|
-
attribute :title, String
|
9
|
-
attribute :prices, Array
|
7
|
+
attribute :id, Types::String
|
8
|
+
attribute :title, Types::String
|
9
|
+
attribute :prices, Types::Array.of(LabeledPrice)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|