telegram-bot-ruby 0.22.0 → 1.0.0.pre
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/CHANGELOG.md +7 -0
- data/README.md +25 -13
- data/Rakefile +43 -0
- data/lib/telegram/bot/api.rb +2 -2
- data/lib/telegram/bot/client.rb +1 -0
- data/lib/telegram/bot/configuration.rb +3 -3
- 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 +27 -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_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/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 +9 -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 +5 -4
- data/lib/telegram/bot/types/input_media_video.rb +10 -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 +63 -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 +5 -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.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 +51 -13
- data/lib/telegram/bot/exceptions.rb +0 -4
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class ChatMemberOwner < ChatMember
|
7
|
+
attribute :status, Types::String
|
8
|
+
attribute :user, User
|
9
|
+
attribute :is_anonymous, Types::Bool
|
10
|
+
attribute? :custom_title, Types::String
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class ChatMemberRestricted < ChatMember
|
7
|
+
attribute :status, Types::String
|
8
|
+
attribute :user, User
|
9
|
+
attribute :is_member, Types::Bool
|
10
|
+
attribute :can_change_info, Types::Bool
|
11
|
+
attribute :can_invite_users, Types::Bool
|
12
|
+
attribute :can_pin_messages, Types::Bool
|
13
|
+
attribute :can_manage_topics, Types::Bool
|
14
|
+
attribute :can_send_messages, Types::Bool
|
15
|
+
attribute :can_send_media_messages, Types::Bool
|
16
|
+
attribute :can_send_polls, Types::Bool
|
17
|
+
attribute :can_send_other_messages, Types::Bool
|
18
|
+
attribute :can_add_web_page_previews, Types::Bool
|
19
|
+
attribute :until_date, Types::Integer
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -6,10 +6,10 @@ module Telegram
|
|
6
6
|
class ChatMemberUpdated < Base
|
7
7
|
attribute :chat, Chat
|
8
8
|
attribute :from, User
|
9
|
-
attribute :date, Integer
|
9
|
+
attribute :date, Types::Integer
|
10
10
|
attribute :old_chat_member, ChatMember
|
11
11
|
attribute :new_chat_member, ChatMember
|
12
|
-
attribute :invite_link, ChatInviteLink
|
12
|
+
attribute? :invite_link, ChatInviteLink
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -4,14 +4,15 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class ChatPermissions < Base
|
7
|
-
attribute :can_send_messages,
|
8
|
-
attribute :can_send_media_messages,
|
9
|
-
attribute :can_send_polls,
|
10
|
-
attribute :can_send_other_messages,
|
11
|
-
attribute :can_add_web_page_previews,
|
12
|
-
attribute :can_change_info,
|
13
|
-
attribute :can_invite_users,
|
14
|
-
attribute :can_pin_messages,
|
7
|
+
attribute? :can_send_messages, Types::Bool
|
8
|
+
attribute? :can_send_media_messages, Types::Bool
|
9
|
+
attribute? :can_send_polls, Types::Bool
|
10
|
+
attribute? :can_send_other_messages, Types::Bool
|
11
|
+
attribute? :can_add_web_page_previews, Types::Bool
|
12
|
+
attribute? :can_change_info, Types::Bool
|
13
|
+
attribute? :can_invite_users, Types::Bool
|
14
|
+
attribute? :can_pin_messages, Types::Bool
|
15
|
+
attribute? :can_manage_topics, Types::Bool
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class ChatPhoto < Base
|
7
|
-
attribute :small_file_id, String
|
8
|
-
attribute :small_file_unique_id, String
|
9
|
-
attribute :big_file_id, String
|
10
|
-
attribute :big_file_unique_id, String
|
7
|
+
attribute :small_file_id, Types::String
|
8
|
+
attribute :small_file_unique_id, Types::String
|
9
|
+
attribute :big_file_id, Types::String
|
10
|
+
attribute :big_file_unique_id, Types::String
|
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 ChosenInlineResult < Base
|
7
|
-
attribute :result_id, String
|
7
|
+
attribute :result_id, Types::String
|
8
8
|
attribute :from, User
|
9
|
-
attribute :location, Location
|
10
|
-
attribute :inline_message_id, String
|
11
|
-
attribute :query, String
|
9
|
+
attribute? :location, Location
|
10
|
+
attribute? :inline_message_id, Types::String
|
11
|
+
attribute :query, Types::String
|
12
12
|
|
13
13
|
alias to_s query
|
14
14
|
end
|
@@ -4,11 +4,11 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class Contact < Base
|
7
|
-
attribute :phone_number, String
|
8
|
-
attribute :first_name, String
|
9
|
-
attribute :last_name, String
|
10
|
-
attribute :user_id, Integer
|
11
|
-
attribute :vcard, String
|
7
|
+
attribute :phone_number, Types::String
|
8
|
+
attribute :first_name, Types::String
|
9
|
+
attribute? :last_name, Types::String
|
10
|
+
attribute? :user_id, Types::Integer
|
11
|
+
attribute? :vcard, Types::String
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -4,12 +4,12 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class Document < Base
|
7
|
-
attribute :file_id, String
|
8
|
-
attribute :file_unique_id, String
|
9
|
-
attribute :thumb, PhotoSize
|
10
|
-
attribute :file_name, String
|
11
|
-
attribute :mime_type, String
|
12
|
-
attribute :file_size, Integer
|
7
|
+
attribute :file_id, Types::String
|
8
|
+
attribute :file_unique_id, Types::String
|
9
|
+
attribute? :thumb, PhotoSize
|
10
|
+
attribute? :file_name, Types::String
|
11
|
+
attribute? :mime_type, Types::String
|
12
|
+
attribute? :file_size, Types::Integer
|
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 EncryptedCredentials < Base
|
7
|
-
attribute :data, String
|
8
|
-
attribute :hash, String
|
9
|
-
attribute :secret, String
|
7
|
+
attribute :data, Types::String
|
8
|
+
attribute :hash, Types::String
|
9
|
+
attribute :secret, Types::String
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -4,16 +4,16 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class EncryptedPassportElement < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :data, String
|
9
|
-
attribute :phone_number, String
|
10
|
-
attribute :email, String
|
11
|
-
attribute :files, Array
|
12
|
-
attribute :front_side, PassportFile
|
13
|
-
attribute :reverse_side, PassportFile
|
14
|
-
attribute :selfie, PassportFile
|
15
|
-
attribute :translation, Array
|
16
|
-
attribute :hash, String
|
7
|
+
attribute :type, Types::String
|
8
|
+
attribute? :data, Types::String
|
9
|
+
attribute? :phone_number, Types::String
|
10
|
+
attribute? :email, Types::String
|
11
|
+
attribute? :files, Types::Array.of(PassportFile)
|
12
|
+
attribute? :front_side, PassportFile
|
13
|
+
attribute? :reverse_side, PassportFile
|
14
|
+
attribute? :selfie, PassportFile
|
15
|
+
attribute? :translation, Types::Array.of(PassportFile)
|
16
|
+
attribute :hash, Types::String
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class File < Base
|
7
|
-
attribute :file_id, String
|
8
|
-
attribute :file_unique_id, String
|
9
|
-
attribute :file_size, Integer
|
10
|
-
attribute :file_path, String
|
7
|
+
attribute :file_id, Types::String
|
8
|
+
attribute :file_unique_id, Types::String
|
9
|
+
attribute? :file_size, Types::Integer
|
10
|
+
attribute? :file_path, Types::String
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -4,9 +4,9 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class ForceReply < Base
|
7
|
-
attribute :force_reply,
|
8
|
-
attribute :input_field_placeholder, String
|
9
|
-
attribute :selective,
|
7
|
+
attribute :force_reply, Types::Bool
|
8
|
+
attribute? :input_field_placeholder, Types::String
|
9
|
+
attribute? :selective, Types::Bool.default(false)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class ForumTopic < Base
|
7
|
+
attribute :message_thread_id, Types::Integer
|
8
|
+
attribute :name, Types::String
|
9
|
+
attribute :icon_color, Types::Integer
|
10
|
+
attribute? :icon_custom_emoji_id, Types::String
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class ForumTopicCreated < Base
|
7
|
+
attribute :name, Types::String
|
8
|
+
attribute :icon_color, Types::Integer
|
9
|
+
attribute? :icon_custom_emoji_id, Types::String
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -4,12 +4,12 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class Game < Base
|
7
|
-
attribute :title, String
|
8
|
-
attribute :description, String
|
9
|
-
attribute :photo, Array
|
10
|
-
attribute :text, String
|
11
|
-
attribute :text_entities, Array
|
12
|
-
attribute :animation, Animation
|
7
|
+
attribute :title, Types::String
|
8
|
+
attribute :description, Types::String
|
9
|
+
attribute :photo, Types::Array.of(PhotoSize)
|
10
|
+
attribute? :text, Types::String
|
11
|
+
attribute? :text_entities, Types::Array.of(MessageEntity)
|
12
|
+
attribute? :animation, Animation
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -4,15 +4,15 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineKeyboardButton < Base
|
7
|
-
attribute :text, String
|
8
|
-
attribute :url, String
|
9
|
-
attribute :callback_data, String
|
10
|
-
attribute :web_app, WebAppInfo
|
11
|
-
attribute :login_url, LoginUrl
|
12
|
-
attribute :switch_inline_query, String
|
13
|
-
attribute :switch_inline_query_current_chat, String
|
14
|
-
attribute :callback_game, CallbackGame
|
15
|
-
attribute :pay,
|
7
|
+
attribute :text, Types::String
|
8
|
+
attribute? :url, Types::String
|
9
|
+
attribute? :callback_data, Types::String
|
10
|
+
attribute? :web_app, WebAppInfo
|
11
|
+
attribute? :login_url, LoginUrl
|
12
|
+
attribute? :switch_inline_query, Types::String
|
13
|
+
attribute? :switch_inline_query_current_chat, Types::String
|
14
|
+
attribute? :callback_game, CallbackGame
|
15
|
+
attribute? :pay, Types::Bool
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -4,7 +4,7 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineKeyboardMarkup < Base
|
7
|
-
attribute :inline_keyboard, Array
|
7
|
+
attribute :inline_keyboard, Types::Array.of(Types::Array.of(InlineKeyboardButton))
|
8
8
|
|
9
9
|
def to_compact_hash
|
10
10
|
hsh = super
|
@@ -4,12 +4,12 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQuery < Base
|
7
|
-
attribute :id, String
|
7
|
+
attribute :id, Types::String
|
8
8
|
attribute :from, User
|
9
|
-
attribute :query, String
|
10
|
-
attribute :offset, String
|
11
|
-
attribute :chat_type, String
|
12
|
-
attribute :location, Location
|
9
|
+
attribute :query, Types::String
|
10
|
+
attribute :offset, Types::String
|
11
|
+
attribute? :chat_type, Types::String
|
12
|
+
attribute? :location, Location
|
13
13
|
|
14
14
|
alias to_s query
|
15
15
|
end
|
@@ -4,17 +4,17 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultArticle < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :title, String
|
7
|
+
attribute :type, Types::String.default('article')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :title, Types::String
|
10
10
|
attribute :input_message_content, InputMessageContent
|
11
|
-
attribute :reply_markup, InlineKeyboardMarkup
|
12
|
-
attribute :url, String
|
13
|
-
attribute :hide_url,
|
14
|
-
attribute :description, String
|
15
|
-
attribute :thumb_url, String
|
16
|
-
attribute :thumb_width, Integer
|
17
|
-
attribute :thumb_height, Integer
|
11
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
12
|
+
attribute? :url, Types::String
|
13
|
+
attribute? :hide_url, Types::Bool
|
14
|
+
attribute? :description, Types::String
|
15
|
+
attribute? :thumb_url, Types::String
|
16
|
+
attribute? :thumb_width, Types::Integer
|
17
|
+
attribute? :thumb_height, Types::Integer
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -4,16 +4,17 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultAudio < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :audio_url, String
|
10
|
-
attribute :title, String
|
11
|
-
attribute :caption, String
|
12
|
-
attribute :parse_mode, String
|
13
|
-
attribute :
|
14
|
-
attribute :
|
15
|
-
attribute :
|
16
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('audio')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :audio_url, Types::String
|
10
|
+
attribute :title, Types::String
|
11
|
+
attribute? :caption, Types::String
|
12
|
+
attribute? :parse_mode, Types::String
|
13
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
14
|
+
attribute? :performer, Types::String
|
15
|
+
attribute? :audio_duration, Types::Integer
|
16
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
17
|
+
attribute? :input_message_content, InputMessageContent
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
@@ -4,13 +4,14 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedAudio < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :audio_file_id, String
|
10
|
-
attribute :caption, String
|
11
|
-
attribute :parse_mode, String
|
12
|
-
attribute :
|
13
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('audio')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :audio_file_id, Types::String
|
10
|
+
attribute? :caption, Types::String
|
11
|
+
attribute? :parse_mode, Types::String
|
12
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
13
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
14
|
+
attribute? :input_message_content, InputMessageContent
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
@@ -4,15 +4,16 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedDocument < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :title, String
|
10
|
-
attribute :document_file_id, String
|
11
|
-
attribute :description, String
|
12
|
-
attribute :caption, String
|
13
|
-
attribute :parse_mode, String
|
14
|
-
attribute :
|
15
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('document')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :title, Types::String
|
10
|
+
attribute :document_file_id, Types::String
|
11
|
+
attribute? :description, Types::String
|
12
|
+
attribute? :caption, Types::String
|
13
|
+
attribute? :parse_mode, Types::String
|
14
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
15
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
16
|
+
attribute? :input_message_content, InputMessageContent
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -4,14 +4,15 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedGif < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :gif_file_id, String
|
10
|
-
attribute :title, String
|
11
|
-
attribute :caption, String
|
12
|
-
attribute :parse_mode, String
|
13
|
-
attribute :
|
14
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('gif')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :gif_file_id, Types::String
|
10
|
+
attribute? :title, Types::String
|
11
|
+
attribute? :caption, Types::String
|
12
|
+
attribute? :parse_mode, Types::String
|
13
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
14
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
15
|
+
attribute? :input_message_content, InputMessageContent
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -4,14 +4,15 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedMpeg4Gif < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :mpeg4_file_id, String
|
10
|
-
attribute :title, String
|
11
|
-
attribute :caption, String
|
12
|
-
attribute :parse_mode, String
|
13
|
-
attribute :
|
14
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('mpeg4_gif')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :mpeg4_file_id, Types::String
|
10
|
+
attribute? :title, Types::String
|
11
|
+
attribute? :caption, Types::String
|
12
|
+
attribute? :parse_mode, Types::String
|
13
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
14
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
15
|
+
attribute? :input_message_content, InputMessageContent
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -4,15 +4,16 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedPhoto < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :photo_file_id, String
|
10
|
-
attribute :title, String
|
11
|
-
attribute :description, String
|
12
|
-
attribute :caption, String
|
13
|
-
attribute :parse_mode, String
|
14
|
-
attribute :
|
15
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('photo')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :photo_file_id, Types::String
|
10
|
+
attribute? :title, Types::String
|
11
|
+
attribute? :description, Types::String
|
12
|
+
attribute? :caption, Types::String
|
13
|
+
attribute? :parse_mode, Types::String
|
14
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
15
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
16
|
+
attribute? :input_message_content, InputMessageContent
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -4,11 +4,11 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedSticker < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :sticker_file_id, String
|
10
|
-
attribute :reply_markup, InlineKeyboardMarkup
|
11
|
-
attribute :input_message_content, InputMessageContent
|
7
|
+
attribute :type, Types::String.default('sticker')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :sticker_file_id, Types::String
|
10
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
11
|
+
attribute? :input_message_content, InputMessageContent
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -4,15 +4,16 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedVideo < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :video_file_id, String
|
10
|
-
attribute :title, String
|
11
|
-
attribute :description, String
|
12
|
-
attribute :caption, String
|
13
|
-
attribute :parse_mode, String
|
14
|
-
attribute :
|
15
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('video')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :video_file_id, Types::String
|
10
|
+
attribute :title, Types::String
|
11
|
+
attribute? :description, Types::String
|
12
|
+
attribute? :caption, Types::String
|
13
|
+
attribute? :parse_mode, Types::String
|
14
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
15
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
16
|
+
attribute? :input_message_content, InputMessageContent
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -4,14 +4,15 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultCachedVoice < Base
|
7
|
-
attribute :type, String
|
8
|
-
attribute :id, String
|
9
|
-
attribute :voice_file_id, String
|
10
|
-
attribute :title, String
|
11
|
-
attribute :caption, String
|
12
|
-
attribute :parse_mode, String
|
13
|
-
attribute :
|
14
|
-
attribute :
|
7
|
+
attribute :type, Types::String.default('voice')
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :voice_file_id, Types::String
|
10
|
+
attribute :title, Types::String
|
11
|
+
attribute? :caption, Types::String
|
12
|
+
attribute? :parse_mode, Types::String
|
13
|
+
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
14
|
+
attribute? :reply_markup, InlineKeyboardMarkup
|
15
|
+
attribute? :input_message_content, InputMessageContent
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|