telegram-bot-ruby 0.17.0 → 0.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -3
- data/CHANGELOG.md +14 -0
- data/Gemfile +2 -0
- data/Rakefile +3 -1
- data/examples/bot.rb +2 -0
- data/lib/telegram/bot/api.rb +13 -5
- data/lib/telegram/bot/client.rb +4 -3
- data/lib/telegram/bot/configuration.rb +5 -1
- data/lib/telegram/bot/exceptions/base.rb +2 -0
- data/lib/telegram/bot/exceptions/response_error.rb +3 -0
- data/lib/telegram/bot/exceptions.rb +2 -0
- data/lib/telegram/bot/null_logger.rb +3 -1
- data/lib/telegram/bot/types/animation.rb +2 -0
- data/lib/telegram/bot/types/audio.rb +2 -0
- data/lib/telegram/bot/types/base.rb +2 -0
- data/lib/telegram/bot/types/bot_command.rb +12 -0
- data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +11 -0
- data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +11 -0
- data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +11 -0
- data/lib/telegram/bot/types/bot_command_scope_chat.rb +12 -0
- data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +12 -0
- data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +13 -0
- data/lib/telegram/bot/types/bot_command_scope_default.rb +11 -0
- data/lib/telegram/bot/types/callback_game.rb +2 -0
- data/lib/telegram/bot/types/callback_query.rb +2 -0
- data/lib/telegram/bot/types/chat.rb +9 -1
- data/lib/telegram/bot/types/chat_administrator_rights.rb +21 -0
- data/lib/telegram/bot/types/chat_invite_link.rb +5 -0
- data/lib/telegram/bot/types/chat_join_request.rb +15 -0
- data/lib/telegram/bot/types/chat_location.rb +2 -0
- data/lib/telegram/bot/types/chat_member.rb +3 -1
- data/lib/telegram/bot/types/chat_member_updated.rb +2 -0
- data/lib/telegram/bot/types/chat_permissions.rb +2 -0
- data/lib/telegram/bot/types/chat_photo.rb +2 -0
- data/lib/telegram/bot/types/chosen_inline_result.rb +2 -0
- data/lib/telegram/bot/types/compactable.rb +4 -2
- data/lib/telegram/bot/types/contact.rb +2 -0
- data/lib/telegram/bot/types/dice.rb +2 -0
- data/lib/telegram/bot/types/document.rb +2 -0
- data/lib/telegram/bot/types/encrypted_credentials.rb +2 -0
- data/lib/telegram/bot/types/encrypted_passport_element.rb +2 -0
- data/lib/telegram/bot/types/file.rb +2 -0
- data/lib/telegram/bot/types/force_reply.rb +3 -0
- data/lib/telegram/bot/types/game.rb +2 -0
- data/lib/telegram/bot/types/game_high_score.rb +2 -0
- data/lib/telegram/bot/types/inline_keyboard_button.rb +4 -1
- data/lib/telegram/bot/types/inline_keyboard_markup.rb +2 -0
- data/lib/telegram/bot/types/inline_query.rb +4 -1
- data/lib/telegram/bot/types/inline_query_result_article.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_audio.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_document.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_video.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_contact.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_document.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_game.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_location.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_photo.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_venue.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_video.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_voice.rb +2 -0
- data/lib/telegram/bot/types/input_contact_message_content.rb +2 -0
- data/lib/telegram/bot/types/input_invoice_message_content.rb +30 -0
- data/lib/telegram/bot/types/input_location_message_content.rb +2 -0
- data/lib/telegram/bot/types/input_media_animation.rb +2 -0
- data/lib/telegram/bot/types/input_media_audio.rb +2 -0
- data/lib/telegram/bot/types/input_media_document.rb +2 -0
- data/lib/telegram/bot/types/input_media_photo.rb +2 -0
- data/lib/telegram/bot/types/input_media_video.rb +2 -0
- data/lib/telegram/bot/types/input_message_content.rb +2 -0
- data/lib/telegram/bot/types/input_text_message_content.rb +2 -0
- data/lib/telegram/bot/types/input_venue_message_content.rb +2 -0
- data/lib/telegram/bot/types/invoice.rb +2 -0
- data/lib/telegram/bot/types/keyboard_button.rb +3 -0
- data/lib/telegram/bot/types/keyboard_button_poll_type.rb +2 -0
- data/lib/telegram/bot/types/labeled_price.rb +2 -0
- data/lib/telegram/bot/types/location.rb +2 -0
- data/lib/telegram/bot/types/login_url.rb +2 -0
- data/lib/telegram/bot/types/mask_position.rb +2 -0
- data/lib/telegram/bot/types/menu_button_commands.rb +11 -0
- data/lib/telegram/bot/types/menu_button_default.rb +11 -0
- data/lib/telegram/bot/types/menu_button_web_app.rb +13 -0
- data/lib/telegram/bot/types/message.rb +15 -9
- data/lib/telegram/bot/types/message_auto_delete_timer_changed.rb +2 -0
- data/lib/telegram/bot/types/message_entity.rb +2 -0
- data/lib/telegram/bot/types/order_info.rb +2 -0
- data/lib/telegram/bot/types/passport_data.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_data_field.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_file.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_files.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_front_side.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_selfie.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_translation_file.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_translation_files.rb +2 -0
- data/lib/telegram/bot/types/passport_element_error_unspecified.rb +2 -0
- data/lib/telegram/bot/types/passport_file.rb +2 -0
- data/lib/telegram/bot/types/pattern_matching.rb +2 -0
- data/lib/telegram/bot/types/photo_size.rb +2 -0
- data/lib/telegram/bot/types/poll.rb +2 -0
- data/lib/telegram/bot/types/poll_answer.rb +2 -0
- data/lib/telegram/bot/types/poll_option.rb +2 -0
- data/lib/telegram/bot/types/pre_checkout_query.rb +2 -0
- data/lib/telegram/bot/types/proximity_alert_triggered.rb +2 -0
- data/lib/telegram/bot/types/reply_keyboard_markup.rb +3 -0
- data/lib/telegram/bot/types/reply_keyboard_remove.rb +2 -0
- data/lib/telegram/bot/types/sent_web_app_message.rb +11 -0
- data/lib/telegram/bot/types/shipping_address.rb +2 -0
- data/lib/telegram/bot/types/shipping_option.rb +2 -0
- data/lib/telegram/bot/types/shipping_query.rb +2 -0
- data/lib/telegram/bot/types/sticker.rb +3 -0
- data/lib/telegram/bot/types/sticker_set.rb +3 -0
- data/lib/telegram/bot/types/successful_payment.rb +2 -0
- data/lib/telegram/bot/types/update.rb +3 -0
- data/lib/telegram/bot/types/user.rb +2 -0
- data/lib/telegram/bot/types/user_profile_photos.rb +2 -0
- data/lib/telegram/bot/types/venue.rb +2 -0
- data/lib/telegram/bot/types/video.rb +2 -0
- data/lib/telegram/bot/types/{voice_chat_ended.rb → video_chat_ended.rb} +3 -1
- data/lib/telegram/bot/types/{voice_chat_participants_invited.rb → video_chat_participants_invited.rb} +3 -1
- data/lib/telegram/bot/types/video_chat_scheduled.rb +11 -0
- data/lib/telegram/bot/types/{voice_chat_started.rb → video_chat_started.rb} +3 -1
- data/lib/telegram/bot/types/video_note.rb +2 -0
- data/lib/telegram/bot/types/voice.rb +2 -0
- data/lib/telegram/bot/types/web_app_data.rb +12 -0
- data/lib/telegram/bot/types/web_app_info.rb +11 -0
- data/lib/telegram/bot/types/webhook_info.rb +3 -1
- data/lib/telegram/bot/types.rb +25 -5
- data/lib/telegram/bot/version.rb +3 -1
- data/lib/telegram/bot.rb +2 -0
- data/telegram-bot-ruby.gemspec +8 -5
- metadata +53 -21
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class InputInvoiceMessageContent < InputMessageContent
|
7
|
+
attribute :title, String
|
8
|
+
attribute :description, String
|
9
|
+
attribute :payload, String
|
10
|
+
attribute :provider_token, String
|
11
|
+
attribute :currency, String
|
12
|
+
attribute :prices, Array[LabeledPrice]
|
13
|
+
attribute :max_tip_amount, Integer
|
14
|
+
attribute :suggested_tip_amounts, Array[Integer]
|
15
|
+
attribute :provider_data, String
|
16
|
+
attribute :photo_url, String
|
17
|
+
attribute :photo_size, Integer
|
18
|
+
attribute :photo_width, Integer
|
19
|
+
attribute :photo_height, Integer
|
20
|
+
attribute :need_name, Boolean
|
21
|
+
attribute :need_phone_number, Boolean
|
22
|
+
attribute :need_email, Boolean
|
23
|
+
attribute :need_shipping_address, Boolean
|
24
|
+
attribute :send_phone_number_to_provider, Boolean
|
25
|
+
attribute :send_email_to_provider, Boolean
|
26
|
+
attribute :is_flexible, Boolean
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
@@ -6,6 +8,7 @@ module Telegram
|
|
6
8
|
attribute :request_contact, Boolean
|
7
9
|
attribute :request_location, Boolean
|
8
10
|
attribute :request_poll, KeyboardButtonPollType
|
11
|
+
attribute :web_app, WebAppInfo
|
9
12
|
end
|
10
13
|
end
|
11
14
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
@@ -13,29 +15,31 @@ module Telegram
|
|
13
15
|
attribute :forward_signature, String
|
14
16
|
attribute :forward_sender_name, String
|
15
17
|
attribute :forward_date, Integer
|
18
|
+
attribute :is_automatic_forward, Boolean
|
16
19
|
attribute :reply_to_message, Message
|
17
20
|
attribute :via_bot, User
|
18
21
|
attribute :edit_date, Integer
|
22
|
+
attribute :has_protected_content, Boolean
|
19
23
|
attribute :media_group_id, String
|
20
24
|
attribute :author_signature, String
|
21
25
|
attribute :text, String
|
22
26
|
attribute :entities, Array[MessageEntity]
|
23
|
-
attribute :
|
27
|
+
attribute :animation, Animation
|
24
28
|
attribute :audio, Audio
|
25
29
|
attribute :document, Document
|
26
|
-
attribute :animation, Animation
|
27
|
-
attribute :game, Game
|
28
30
|
attribute :photo, Array[PhotoSize]
|
29
31
|
attribute :sticker, Sticker
|
30
32
|
attribute :video, Video
|
31
|
-
attribute :voice, Voice
|
32
33
|
attribute :video_note, VideoNote
|
34
|
+
attribute :voice, Voice
|
33
35
|
attribute :caption, String
|
36
|
+
attribute :caption_entities, Array[MessageEntity]
|
34
37
|
attribute :contact, Contact
|
35
38
|
attribute :dice, Dice
|
36
|
-
attribute :
|
37
|
-
attribute :venue, Venue
|
39
|
+
attribute :game, Game
|
38
40
|
attribute :poll, Poll
|
41
|
+
attribute :venue, Venue
|
42
|
+
attribute :location, Location
|
39
43
|
attribute :new_chat_members, Array[User]
|
40
44
|
attribute :left_chat_member, User
|
41
45
|
attribute :new_chat_title, String
|
@@ -53,9 +57,11 @@ module Telegram
|
|
53
57
|
attribute :connected_website, String
|
54
58
|
attribute :passport_data, PassportData
|
55
59
|
attribute :proximity_alert_triggered, ProximityAlertTriggered
|
56
|
-
attribute :
|
57
|
-
attribute :
|
58
|
-
attribute :
|
60
|
+
attribute :video_chat_scheduled, VideoChatScheduled
|
61
|
+
attribute :video_chat_started, VideoChatStarted
|
62
|
+
attribute :video_chat_ended, VideoChatEnded
|
63
|
+
attribute :video_chat_participants_invited, VideoChatParticipantsInvited
|
64
|
+
attribute :web_app_data, WebAppData
|
59
65
|
attribute :reply_markup, InlineKeyboardMarkup
|
60
66
|
|
61
67
|
alias to_s text
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
@@ -5,6 +7,7 @@ module Telegram
|
|
5
7
|
attribute :keyboard, Array[Array[KeyboardButton]]
|
6
8
|
attribute :resize_keyboard, Boolean, default: false
|
7
9
|
attribute :one_time_keyboard, Boolean, default: false
|
10
|
+
attribute :input_field_placeholder, String
|
8
11
|
attribute :selective, Boolean, default: false
|
9
12
|
|
10
13
|
def to_compact_hash
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
@@ -7,6 +9,7 @@ module Telegram
|
|
7
9
|
attribute :width, Integer
|
8
10
|
attribute :height, Integer
|
9
11
|
attribute :is_animated, Boolean
|
12
|
+
attribute :is_video, Boolean
|
10
13
|
attribute :thumb, PhotoSize
|
11
14
|
attribute :emoji, String
|
12
15
|
attribute :set_name, String
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
@@ -5,6 +7,7 @@ module Telegram
|
|
5
7
|
attribute :name, String
|
6
8
|
attribute :title, String
|
7
9
|
attribute :is_animated, Boolean
|
10
|
+
attribute :is_video, Boolean
|
8
11
|
attribute :contains_masks, Boolean
|
9
12
|
attribute :stickers, Array[Sticker]
|
10
13
|
attribute :thumb, PhotoSize
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
@@ -16,6 +18,7 @@ module Telegram
|
|
16
18
|
attribute :poll_answer, PollAnswer
|
17
19
|
attribute :my_chat_member, ChatMemberUpdated
|
18
20
|
attribute :chat_member, ChatMemberUpdated
|
21
|
+
attribute :chat_join_request, ChatJoinRequest
|
19
22
|
|
20
23
|
def current_message
|
21
24
|
@current_message ||=
|