telegram-bot-ruby 2.4.0 → 2.6.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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/skills/update-api/SKILL.md +70 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +19 -0
  5. data/CHANGELOG.md +16 -0
  6. data/README.md +40 -23
  7. data/lib/telegram/bot/api/endpoints.rb +110 -62
  8. data/lib/telegram/bot/api.rb +13 -1
  9. data/lib/telegram/bot/configuration.rb +2 -1
  10. data/lib/telegram/bot/types/accepted_gift_types.rb +15 -0
  11. data/lib/telegram/bot/types/business_bot_rights.rb +24 -0
  12. data/lib/telegram/bot/types/business_connection.rb +1 -1
  13. data/lib/telegram/bot/types/callback_query.rb +4 -0
  14. data/lib/telegram/bot/types/chat.rb +1 -0
  15. data/lib/telegram/bot/types/chat_administrator_rights.rb +2 -0
  16. data/lib/telegram/bot/types/chat_full_info.rb +7 -1
  17. data/lib/telegram/bot/types/chat_member_administrator.rb +2 -0
  18. data/lib/telegram/bot/types/chat_member_member.rb +1 -0
  19. data/lib/telegram/bot/types/chat_member_restricted.rb +2 -0
  20. data/lib/telegram/bot/types/chat_owner_changed.rb +11 -0
  21. data/lib/telegram/bot/types/chat_owner_left.rb +11 -0
  22. data/lib/telegram/bot/types/chat_permissions.rb +1 -0
  23. data/lib/telegram/bot/types/checklist.rb +15 -0
  24. data/lib/telegram/bot/types/checklist_task.rb +16 -0
  25. data/lib/telegram/bot/types/checklist_tasks_added.rb +12 -0
  26. data/lib/telegram/bot/types/checklist_tasks_done.rb +13 -0
  27. data/lib/telegram/bot/types/direct_message_price_changed.rb +12 -0
  28. data/lib/telegram/bot/types/direct_messages_topic.rb +12 -0
  29. data/lib/telegram/bot/types/external_reply_info.rb +1 -0
  30. data/lib/telegram/bot/types/forum_topic.rb +1 -0
  31. data/lib/telegram/bot/types/forum_topic_created.rb +1 -0
  32. data/lib/telegram/bot/types/gift.rb +7 -0
  33. data/lib/telegram/bot/types/gift_background.rb +13 -0
  34. data/lib/telegram/bot/types/gift_info.rb +20 -0
  35. data/lib/telegram/bot/types/inline_keyboard_button.rb +2 -0
  36. data/lib/telegram/bot/types/input_checklist.rb +16 -0
  37. data/lib/telegram/bot/types/input_checklist_task.rb +14 -0
  38. data/lib/telegram/bot/types/input_file.rb +10 -0
  39. data/lib/telegram/bot/types/input_profile_photo.rb +15 -0
  40. data/lib/telegram/bot/types/input_profile_photo_animated.rb +13 -0
  41. data/lib/telegram/bot/types/input_profile_photo_static.rb +12 -0
  42. data/lib/telegram/bot/types/input_story_content.rb +15 -0
  43. data/lib/telegram/bot/types/input_story_content_photo.rb +12 -0
  44. data/lib/telegram/bot/types/input_story_content_video.rb +15 -0
  45. data/lib/telegram/bot/types/keyboard_button.rb +2 -0
  46. data/lib/telegram/bot/types/location_address.rb +14 -0
  47. data/lib/telegram/bot/types/message.rb +24 -1
  48. data/lib/telegram/bot/types/message_entity.rb +2 -0
  49. data/lib/telegram/bot/types/owned_gift.rb +15 -0
  50. data/lib/telegram/bot/types/owned_gift_regular.rb +25 -0
  51. data/lib/telegram/bot/types/owned_gift_unique.rb +19 -0
  52. data/lib/telegram/bot/types/owned_gifts.rb +13 -0
  53. data/lib/telegram/bot/types/paid_message_price_changed.rb +11 -0
  54. data/lib/telegram/bot/types/reply_parameters.rb +1 -0
  55. data/lib/telegram/bot/types/star_amount.rb +12 -0
  56. data/lib/telegram/bot/types/story_area.rb +12 -0
  57. data/lib/telegram/bot/types/story_area_position.rb +16 -0
  58. data/lib/telegram/bot/types/story_area_type.rb +18 -0
  59. data/lib/telegram/bot/types/story_area_type_link.rb +12 -0
  60. data/lib/telegram/bot/types/story_area_type_location.rb +14 -0
  61. data/lib/telegram/bot/types/story_area_type_suggested_reaction.rb +14 -0
  62. data/lib/telegram/bot/types/story_area_type_unique_gift.rb +12 -0
  63. data/lib/telegram/bot/types/story_area_type_weather.rb +14 -0
  64. data/lib/telegram/bot/types/suggested_post_approval_failed.rb +12 -0
  65. data/lib/telegram/bot/types/suggested_post_approved.rb +13 -0
  66. data/lib/telegram/bot/types/suggested_post_declined.rb +12 -0
  67. data/lib/telegram/bot/types/suggested_post_info.rb +13 -0
  68. data/lib/telegram/bot/types/suggested_post_paid.rb +14 -0
  69. data/lib/telegram/bot/types/suggested_post_parameters.rb +12 -0
  70. data/lib/telegram/bot/types/suggested_post_price.rb +12 -0
  71. data/lib/telegram/bot/types/suggested_post_refunded.rb +12 -0
  72. data/lib/telegram/bot/types/transaction_partner_user.rb +2 -0
  73. data/lib/telegram/bot/types/unique_gift.rb +22 -0
  74. data/lib/telegram/bot/types/unique_gift_backdrop.rb +13 -0
  75. data/lib/telegram/bot/types/unique_gift_backdrop_colors.rb +14 -0
  76. data/lib/telegram/bot/types/unique_gift_colors.rb +16 -0
  77. data/lib/telegram/bot/types/unique_gift_info.rb +17 -0
  78. data/lib/telegram/bot/types/unique_gift_model.rb +14 -0
  79. data/lib/telegram/bot/types/unique_gift_symbol.rb +13 -0
  80. data/lib/telegram/bot/types/user.rb +2 -0
  81. data/lib/telegram/bot/types/user_profile_audios.rb +12 -0
  82. data/lib/telegram/bot/types/user_rating.rb +14 -0
  83. data/lib/telegram/bot/types/video.rb +1 -0
  84. data/lib/telegram/bot/types/video_quality.rb +16 -0
  85. data/lib/telegram/bot/version.rb +1 -1
  86. data/rakelib/builders/endpoints_builder.rb +51 -0
  87. data/rakelib/builders/type_builder.rb +140 -0
  88. data/rakelib/parse.rake +31 -0
  89. data/rakelib/parsers/methods_parser.rb +115 -0
  90. data/rakelib/parsers/types_parser.rb +273 -0
  91. data/rakelib/rebuild.rake +30 -0
  92. data/rakelib/templates/endpoints.erb +13 -0
  93. metadata +65 -9
  94. data/rakelib/parse_schema.rake +0 -73
  95. data/rakelib/rebuild_types.rake +0 -90
@@ -5,6 +5,7 @@ module Telegram
5
5
  module Types
6
6
  class ChatMemberRestricted < Base
7
7
  attribute :status, Types::String.constrained(eql: 'restricted').default('restricted')
8
+ attribute? :tag, Types::String
8
9
  attribute :user, User
9
10
  attribute :is_member, Types::Bool
10
11
  attribute :can_send_messages, Types::Bool
@@ -17,6 +18,7 @@ module Telegram
17
18
  attribute :can_send_polls, Types::Bool
18
19
  attribute :can_send_other_messages, Types::Bool
19
20
  attribute :can_add_web_page_previews, Types::Bool
21
+ attribute :can_edit_tag, Types::Bool
20
22
  attribute :can_change_info, Types::Bool
21
23
  attribute :can_invite_users, Types::Bool
22
24
  attribute :can_pin_messages, Types::Bool
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChatOwnerChanged < Base
7
+ attribute :new_owner, User
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChatOwnerLeft < Base
7
+ attribute? :new_owner, User
8
+ end
9
+ end
10
+ end
11
+ end
@@ -14,6 +14,7 @@ module Telegram
14
14
  attribute? :can_send_polls, Types::Bool
15
15
  attribute? :can_send_other_messages, Types::Bool
16
16
  attribute? :can_add_web_page_previews, Types::Bool
17
+ attribute? :can_edit_tag, Types::Bool
17
18
  attribute? :can_change_info, Types::Bool
18
19
  attribute? :can_invite_users, Types::Bool
19
20
  attribute? :can_pin_messages, Types::Bool
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Checklist < Base
7
+ attribute :title, Types::String
8
+ attribute? :title_entities, Types::Array.of(MessageEntity)
9
+ attribute :tasks, Types::Array.of(ChecklistTask)
10
+ attribute? :others_can_add_tasks, Types::True
11
+ attribute? :others_can_mark_tasks_as_done, Types::True
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChecklistTask < Base
7
+ attribute :id, Types::Integer
8
+ attribute :text, Types::String
9
+ attribute? :text_entities, Types::Array.of(MessageEntity)
10
+ attribute? :completed_by_user, User
11
+ attribute? :completed_by_chat, Chat
12
+ attribute? :completion_date, Types::Integer
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChecklistTasksAdded < Base
7
+ attribute? :checklist_message, Message
8
+ attribute :tasks, Types::Array.of(ChecklistTask)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChecklistTasksDone < Base
7
+ attribute? :checklist_message, Message
8
+ attribute? :marked_as_done_task_ids, Types::Array.of(Types::Integer)
9
+ attribute? :marked_as_not_done_task_ids, Types::Array.of(Types::Integer)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class DirectMessagePriceChanged < Base
7
+ attribute :are_direct_messages_enabled, Types::Bool
8
+ attribute? :direct_message_star_count, Types::Integer.default(0)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class DirectMessagesTopic < Base
7
+ attribute :topic_id, Types::Integer
8
+ attribute? :user, User
9
+ end
10
+ end
11
+ end
12
+ end
@@ -19,6 +19,7 @@ module Telegram
19
19
  attribute? :video_note, VideoNote
20
20
  attribute? :voice, Voice
21
21
  attribute? :has_media_spoiler, Types::True
22
+ attribute? :checklist, Checklist
22
23
  attribute? :contact, Contact
23
24
  attribute? :dice, Dice
24
25
  attribute? :game, Game
@@ -8,6 +8,7 @@ module Telegram
8
8
  attribute :name, Types::String
9
9
  attribute :icon_color, Types::Integer
10
10
  attribute? :icon_custom_emoji_id, Types::String
11
+ attribute? :is_name_implicit, Types::True
11
12
  end
12
13
  end
13
14
  end
@@ -7,6 +7,7 @@ module Telegram
7
7
  attribute :name, Types::String
8
8
  attribute :icon_color, Types::Integer
9
9
  attribute? :icon_custom_emoji_id, Types::String
10
+ attribute? :is_name_implicit, Types::True
10
11
  end
11
12
  end
12
13
  end
@@ -8,8 +8,15 @@ module Telegram
8
8
  attribute :sticker, Sticker
9
9
  attribute :star_count, Types::Integer
10
10
  attribute? :upgrade_star_count, Types::Integer
11
+ attribute? :is_premium, Types::True
12
+ attribute? :has_colors, Types::True
11
13
  attribute? :total_count, Types::Integer
12
14
  attribute? :remaining_count, Types::Integer
15
+ attribute? :personal_total_count, Types::Integer
16
+ attribute? :personal_remaining_count, Types::Integer
17
+ attribute? :background, GiftBackground
18
+ attribute? :unique_gift_variant_count, Types::Integer
19
+ attribute? :publisher_chat, Chat
13
20
  end
14
21
  end
15
22
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class GiftBackground < Base
7
+ attribute :center_color, Types::Integer
8
+ attribute :edge_color, Types::Integer
9
+ attribute :text_color, Types::Integer
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class GiftInfo < Base
7
+ attribute :gift, Gift
8
+ attribute? :owned_gift_id, Types::String
9
+ attribute? :convert_star_count, Types::Integer
10
+ attribute? :prepaid_upgrade_star_count, Types::Integer
11
+ attribute? :is_upgrade_separate, Types::True
12
+ attribute? :can_be_upgraded, Types::True
13
+ attribute? :text, Types::String
14
+ attribute? :entities, Types::Array.of(MessageEntity)
15
+ attribute? :is_private, Types::True
16
+ attribute? :unique_gift_number, Types::Integer
17
+ end
18
+ end
19
+ end
20
+ end
@@ -5,6 +5,8 @@ module Telegram
5
5
  module Types
6
6
  class InlineKeyboardButton < Base
7
7
  attribute :text, Types::String
8
+ attribute? :icon_custom_emoji_id, Types::String
9
+ attribute? :style, Types::String
8
10
  attribute? :url, Types::String
9
11
  attribute? :callback_data, Types::String
10
12
  attribute? :web_app, WebAppInfo
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputChecklist < Base
7
+ attribute :title, Types::String.constrained(min_size: 1, max_size: 255)
8
+ attribute? :parse_mode, Types::String
9
+ attribute? :title_entities, Types::Array.of(MessageEntity)
10
+ attribute :tasks, Types::Array.of(InputChecklistTask)
11
+ attribute? :others_can_add_tasks, Types::Bool
12
+ attribute? :others_can_mark_tasks_as_done, Types::Bool
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputChecklistTask < Base
7
+ attribute :id, Types::Integer
8
+ attribute :text, Types::String.constrained(min_size: 1, max_size: 100)
9
+ attribute? :parse_mode, Types::String
10
+ attribute? :text_entities, Types::Array.of(MessageEntity)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputFile < Base
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ ## Just for classes consistency
7
+ # rubocop:disable Naming/ConstantName
8
+ InputProfilePhoto = (
9
+ InputProfilePhotoStatic |
10
+ InputProfilePhotoAnimated
11
+ )
12
+ # rubocop:enable Naming/ConstantName
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputProfilePhotoAnimated < Base
7
+ attribute :type, Types::String.constrained(eql: 'animated').default('animated')
8
+ attribute :animation, Types::String
9
+ attribute? :main_frame_timestamp, Types::Float.default(0.0)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputProfilePhotoStatic < Base
7
+ attribute :type, Types::String.constrained(eql: 'static').default('static')
8
+ attribute :photo, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ ## Just for classes consistency
7
+ # rubocop:disable Naming/ConstantName
8
+ InputStoryContent = (
9
+ InputStoryContentPhoto |
10
+ InputStoryContentVideo
11
+ )
12
+ # rubocop:enable Naming/ConstantName
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputStoryContentPhoto < Base
7
+ attribute :type, Types::String.constrained(eql: 'photo').default('photo')
8
+ attribute :photo, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputStoryContentVideo < Base
7
+ attribute :type, Types::String.constrained(eql: 'video').default('video')
8
+ attribute :video, Types::String
9
+ attribute? :duration, Types::Float
10
+ attribute? :cover_frame_timestamp, Types::Float.default(0.0)
11
+ attribute? :is_animation, Types::Bool
12
+ end
13
+ end
14
+ end
15
+ end
@@ -5,6 +5,8 @@ module Telegram
5
5
  module Types
6
6
  class KeyboardButton < Base
7
7
  attribute :text, Types::String
8
+ attribute? :icon_custom_emoji_id, Types::String
9
+ attribute? :style, Types::String
8
10
  attribute? :request_users, KeyboardButtonRequestUsers
9
11
  attribute? :request_chat, KeyboardButtonRequestChat
10
12
  attribute? :request_contact, Types::Bool
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class LocationAddress < Base
7
+ attribute :country_code, Types::String
8
+ attribute? :state, Types::String
9
+ attribute? :city, Types::String
10
+ attribute? :street, Types::String
11
+ end
12
+ end
13
+ end
14
+ end
@@ -6,10 +6,12 @@ module Telegram
6
6
  class Message < Base
7
7
  attribute :message_id, Types::Integer
8
8
  attribute? :message_thread_id, Types::Integer
9
+ attribute? :direct_messages_topic, DirectMessagesTopic
9
10
  attribute? :from, User
10
11
  attribute? :sender_chat, Chat
11
12
  attribute? :sender_boost_count, Types::Integer
12
13
  attribute? :sender_business_bot, User
14
+ attribute? :sender_tag, Types::String
13
15
  attribute :date, Types::Integer
14
16
  attribute? :business_connection_id, Types::String
15
17
  attribute :chat, Chat
@@ -20,15 +22,19 @@ module Telegram
20
22
  attribute? :external_reply, ExternalReplyInfo
21
23
  attribute? :quote, TextQuote
22
24
  attribute? :reply_to_story, Story
25
+ attribute? :reply_to_checklist_task_id, Types::Integer
23
26
  attribute? :via_bot, User
24
27
  attribute? :edit_date, Types::Integer
25
28
  attribute? :has_protected_content, Types::True
26
29
  attribute? :is_from_offline, Types::True
30
+ attribute? :is_paid_post, Types::True
27
31
  attribute? :media_group_id, Types::String
28
32
  attribute? :author_signature, Types::String
33
+ attribute? :paid_star_count, Types::Integer
29
34
  attribute? :text, Types::String
30
35
  attribute? :entities, Types::Array.of(MessageEntity)
31
36
  attribute? :link_preview_options, LinkPreviewOptions
37
+ attribute? :suggested_post_info, SuggestedPostInfo
32
38
  attribute? :effect_id, Types::String
33
39
  attribute? :animation, Animation
34
40
  attribute? :audio, Audio
@@ -44,6 +50,7 @@ module Telegram
44
50
  attribute? :caption_entities, Types::Array.of(MessageEntity)
45
51
  attribute? :show_caption_above_media, Types::True
46
52
  attribute? :has_media_spoiler, Types::True
53
+ attribute? :checklist, Checklist
47
54
  attribute? :contact, Contact
48
55
  attribute? :dice, Dice
49
56
  attribute? :game, Game
@@ -52,6 +59,8 @@ module Telegram
52
59
  attribute? :location, Location
53
60
  attribute? :new_chat_members, Types::Array.of(User)
54
61
  attribute? :left_chat_member, User
62
+ attribute? :chat_owner_left, ChatOwnerLeft
63
+ attribute? :chat_owner_changed, ChatOwnerChanged
55
64
  attribute? :new_chat_title, Types::String
56
65
  attribute? :new_chat_photo, Types::Array.of(PhotoSize)
57
66
  attribute? :delete_chat_photo, Types::True
@@ -67,12 +76,18 @@ module Telegram
67
76
  attribute? :refunded_payment, RefundedPayment
68
77
  attribute? :users_shared, UsersShared
69
78
  attribute? :chat_shared, ChatShared
79
+ attribute? :gift, GiftInfo
80
+ attribute? :unique_gift, UniqueGiftInfo
81
+ attribute? :gift_upgrade_sent, GiftInfo
70
82
  attribute? :connected_website, Types::String
71
83
  attribute? :write_access_allowed, WriteAccessAllowed
72
84
  attribute? :passport_data, PassportData
73
85
  attribute? :proximity_alert_triggered, ProximityAlertTriggered
74
86
  attribute? :boost_added, ChatBoostAdded
75
87
  attribute? :chat_background_set, ChatBackground
88
+ attribute? :checklist_tasks_done, ChecklistTasksDone
89
+ attribute? :checklist_tasks_added, ChecklistTasksAdded
90
+ attribute? :direct_message_price_changed, DirectMessagePriceChanged
76
91
  attribute? :forum_topic_created, ForumTopicCreated
77
92
  attribute? :forum_topic_edited, ForumTopicEdited
78
93
  attribute? :forum_topic_closed, ForumTopicClosed
@@ -83,6 +98,12 @@ module Telegram
83
98
  attribute? :giveaway, Giveaway
84
99
  attribute? :giveaway_winners, GiveawayWinners
85
100
  attribute? :giveaway_completed, GiveawayCompleted
101
+ attribute? :paid_message_price_changed, PaidMessagePriceChanged
102
+ attribute? :suggested_post_approved, SuggestedPostApproved
103
+ attribute? :suggested_post_approval_failed, SuggestedPostApprovalFailed
104
+ attribute? :suggested_post_declined, SuggestedPostDeclined
105
+ attribute? :suggested_post_paid, SuggestedPostPaid
106
+ attribute? :suggested_post_refunded, SuggestedPostRefunded
86
107
  attribute? :video_chat_scheduled, VideoChatScheduled
87
108
  attribute? :video_chat_started, VideoChatStarted
88
109
  attribute? :video_chat_ended, VideoChatEnded
@@ -90,7 +111,9 @@ module Telegram
90
111
  attribute? :web_app_data, WebAppData
91
112
  attribute? :reply_markup, InlineKeyboardMarkup
92
113
 
93
- alias to_s text
114
+ def to_s
115
+ text.to_s
116
+ end
94
117
  end
95
118
  end
96
119
  end
@@ -11,6 +11,8 @@ module Telegram
11
11
  attribute? :user, User
12
12
  attribute? :language, Types::String
13
13
  attribute? :custom_emoji_id, Types::String
14
+ attribute? :unix_time, Types::Integer
15
+ attribute? :date_time_format, Types::String
14
16
  end
15
17
  end
16
18
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ ## Just for classes consistency
7
+ # rubocop:disable Naming/ConstantName
8
+ OwnedGift = (
9
+ OwnedGiftRegular |
10
+ OwnedGiftUnique
11
+ )
12
+ # rubocop:enable Naming/ConstantName
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class OwnedGiftRegular < Base
7
+ attribute :type, Types::String.constrained(eql: 'regular').default('regular')
8
+ attribute :gift, Gift
9
+ attribute? :owned_gift_id, Types::String
10
+ attribute? :sender_user, User
11
+ attribute :send_date, Types::Integer
12
+ attribute? :text, Types::String
13
+ attribute? :entities, Types::Array.of(MessageEntity)
14
+ attribute? :is_private, Types::True
15
+ attribute? :is_saved, Types::True
16
+ attribute? :can_be_upgraded, Types::True
17
+ attribute? :was_refunded, Types::True
18
+ attribute? :convert_star_count, Types::Integer
19
+ attribute? :prepaid_upgrade_star_count, Types::Integer
20
+ attribute? :is_upgrade_separate, Types::True
21
+ attribute? :unique_gift_number, Types::Integer
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class OwnedGiftUnique < Base
7
+ attribute :type, Types::String.constrained(eql: 'unique').default('unique')
8
+ attribute :gift, UniqueGift
9
+ attribute? :owned_gift_id, Types::String
10
+ attribute? :sender_user, User
11
+ attribute :send_date, Types::Integer
12
+ attribute? :is_saved, Types::True
13
+ attribute? :can_be_transferred, Types::True
14
+ attribute? :transfer_star_count, Types::Integer
15
+ attribute? :next_transfer_date, Types::Integer
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class OwnedGifts < Base
7
+ attribute :total_count, Types::Integer
8
+ attribute :gifts, Types::Array.of(OwnedGift)
9
+ attribute? :next_offset, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class PaidMessagePriceChanged < Base
7
+ attribute :paid_message_star_count, Types::Integer
8
+ end
9
+ end
10
+ end
11
+ end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :quote_parse_mode, Types::String
12
12
  attribute? :quote_entities, Types::Array.of(MessageEntity)
13
13
  attribute? :quote_position, Types::Integer
14
+ attribute? :checklist_task_id, Types::Integer
14
15
  end
15
16
  end
16
17
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class StarAmount < Base
7
+ attribute :amount, Types::Integer
8
+ attribute? :nanostar_amount, Types::Integer
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class StoryArea < Base
7
+ attribute :position, StoryAreaPosition
8
+ attribute :type, StoryAreaType
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class StoryAreaPosition < Base
7
+ attribute :x_percentage, Types::Float
8
+ attribute :y_percentage, Types::Float
9
+ attribute :width_percentage, Types::Float
10
+ attribute :height_percentage, Types::Float
11
+ attribute :rotation_angle, Types::Float
12
+ attribute :corner_radius_percentage, Types::Float
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ ## Just for classes consistency
7
+ # rubocop:disable Naming/ConstantName
8
+ StoryAreaType = (
9
+ StoryAreaTypeLocation |
10
+ StoryAreaTypeSuggestedReaction |
11
+ StoryAreaTypeLink |
12
+ StoryAreaTypeWeather |
13
+ StoryAreaTypeUniqueGift
14
+ )
15
+ # rubocop:enable Naming/ConstantName
16
+ end
17
+ end
18
+ end