telegram-bot-ruby 2.4.0 → 2.5.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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +19 -0
  3. data/CHANGELOG.md +7 -0
  4. data/lib/telegram/bot/api/endpoints.rb +102 -62
  5. data/lib/telegram/bot/types/accepted_gift_types.rb +14 -0
  6. data/lib/telegram/bot/types/business_bot_rights.rb +24 -0
  7. data/lib/telegram/bot/types/business_connection.rb +1 -1
  8. data/lib/telegram/bot/types/chat.rb +1 -0
  9. data/lib/telegram/bot/types/chat_administrator_rights.rb +1 -0
  10. data/lib/telegram/bot/types/chat_full_info.rb +3 -1
  11. data/lib/telegram/bot/types/chat_member_administrator.rb +1 -0
  12. data/lib/telegram/bot/types/checklist.rb +15 -0
  13. data/lib/telegram/bot/types/checklist_task.rb +15 -0
  14. data/lib/telegram/bot/types/checklist_tasks_added.rb +12 -0
  15. data/lib/telegram/bot/types/checklist_tasks_done.rb +13 -0
  16. data/lib/telegram/bot/types/direct_message_price_changed.rb +12 -0
  17. data/lib/telegram/bot/types/direct_messages_topic.rb +12 -0
  18. data/lib/telegram/bot/types/external_reply_info.rb +1 -0
  19. data/lib/telegram/bot/types/gift.rb +1 -0
  20. data/lib/telegram/bot/types/gift_info.rb +18 -0
  21. data/lib/telegram/bot/types/input_checklist.rb +16 -0
  22. data/lib/telegram/bot/types/input_checklist_task.rb +14 -0
  23. data/lib/telegram/bot/types/input_file.rb +10 -0
  24. data/lib/telegram/bot/types/input_profile_photo.rb +15 -0
  25. data/lib/telegram/bot/types/input_profile_photo_animated.rb +13 -0
  26. data/lib/telegram/bot/types/input_profile_photo_static.rb +12 -0
  27. data/lib/telegram/bot/types/input_story_content.rb +15 -0
  28. data/lib/telegram/bot/types/input_story_content_photo.rb +12 -0
  29. data/lib/telegram/bot/types/input_story_content_video.rb +15 -0
  30. data/lib/telegram/bot/types/location_address.rb +14 -0
  31. data/lib/telegram/bot/types/message.rb +17 -0
  32. data/lib/telegram/bot/types/owned_gift.rb +15 -0
  33. data/lib/telegram/bot/types/owned_gift_regular.rb +23 -0
  34. data/lib/telegram/bot/types/owned_gift_unique.rb +19 -0
  35. data/lib/telegram/bot/types/owned_gifts.rb +13 -0
  36. data/lib/telegram/bot/types/paid_message_price_changed.rb +11 -0
  37. data/lib/telegram/bot/types/reply_parameters.rb +1 -0
  38. data/lib/telegram/bot/types/star_amount.rb +12 -0
  39. data/lib/telegram/bot/types/story_area.rb +12 -0
  40. data/lib/telegram/bot/types/story_area_position.rb +16 -0
  41. data/lib/telegram/bot/types/story_area_type.rb +18 -0
  42. data/lib/telegram/bot/types/story_area_type_link.rb +12 -0
  43. data/lib/telegram/bot/types/story_area_type_location.rb +14 -0
  44. data/lib/telegram/bot/types/story_area_type_suggested_reaction.rb +14 -0
  45. data/lib/telegram/bot/types/story_area_type_unique_gift.rb +12 -0
  46. data/lib/telegram/bot/types/story_area_type_weather.rb +14 -0
  47. data/lib/telegram/bot/types/suggested_post_approval_failed.rb +12 -0
  48. data/lib/telegram/bot/types/suggested_post_approved.rb +13 -0
  49. data/lib/telegram/bot/types/suggested_post_declined.rb +12 -0
  50. data/lib/telegram/bot/types/suggested_post_info.rb +13 -0
  51. data/lib/telegram/bot/types/suggested_post_paid.rb +14 -0
  52. data/lib/telegram/bot/types/suggested_post_parameters.rb +12 -0
  53. data/lib/telegram/bot/types/suggested_post_price.rb +12 -0
  54. data/lib/telegram/bot/types/suggested_post_refunded.rb +12 -0
  55. data/lib/telegram/bot/types/transaction_partner_user.rb +2 -0
  56. data/lib/telegram/bot/types/unique_gift.rb +17 -0
  57. data/lib/telegram/bot/types/unique_gift_backdrop.rb +13 -0
  58. data/lib/telegram/bot/types/unique_gift_backdrop_colors.rb +14 -0
  59. data/lib/telegram/bot/types/unique_gift_info.rb +16 -0
  60. data/lib/telegram/bot/types/unique_gift_model.rb +13 -0
  61. data/lib/telegram/bot/types/unique_gift_symbol.rb +13 -0
  62. data/lib/telegram/bot/version.rb +1 -1
  63. data/rakelib/builders/endpoints_builder.rb +51 -0
  64. data/rakelib/builders/type_builder.rb +140 -0
  65. data/rakelib/parse.rake +31 -0
  66. data/rakelib/parsers/methods_parser.rb +115 -0
  67. data/rakelib/parsers/types_parser.rb +273 -0
  68. data/rakelib/rebuild.rake +30 -0
  69. data/rakelib/templates/endpoints.erb +13 -0
  70. metadata +57 -9
  71. data/rakelib/parse_schema.rake +0 -73
  72. data/rakelib/rebuild_types.rake +0 -90
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff4330f4093442f82cfae26bfecfb8a740f64f2c5b6b40c21506c04372f60f8c
4
- data.tar.gz: 7aec5d2067a6b6476c5fa7c123c282ba4dd57c4b491189bcd1287c4946d3c188
3
+ metadata.gz: 83c30ffac80ea5559686756be98a5e98d658e6011b1fce283cb5738a3fdb5e47
4
+ data.tar.gz: ec475ab5058610092287d0c92dad8547ab848b933aeee1d41068e0384cebf5a9
5
5
  SHA512:
6
- metadata.gz: 24ab6cb2d05c0886409c64f6c0cbe34f7d0a4633c0b5433d980a3cbd5702f3bee90b135ef8653cd0c453eb9beae347c69294d286a9107f90a2df85eb573ad01f
7
- data.tar.gz: 3982421d44ac9b3a9588b1c752f701c95cca1f986dce9d6a03b64a6225790ab415c713b92e6ff88fe285ed227b6bc5fb271b332b749c7a8083298a4daa269fa8
6
+ metadata.gz: 190793765c8bd99d382b20d81878234fc63885c55f1a4666a79e50bb6c9ed720ea4a964690c8230b63bcbb723b84e6462263ec0a75b67a681ebde062b1200efe
7
+ data.tar.gz: 3f1c1874c4a888590f9c6f8370486bc7097dadf9264795c71f1a5f8ca0afb62a8152eb0f4778c6ccb8bdf6a1d6f66f0f0304a8eec3f8b18fc5d8eb1eea5187a3
data/.rubocop.yml CHANGED
@@ -16,17 +16,36 @@ Metrics/BlockLength:
16
16
  - context
17
17
  - describe
18
18
  - task
19
+
19
20
  Metrics/ClassLength:
20
21
  Exclude:
21
22
  - lib/telegram/bot/api/endpoints.rb
23
+ - lib/telegram/bot/types/message.rb
24
+ - rakelib/builders/type_builder.rb
25
+ - rakelib/parsers/**/*
26
+
22
27
  Metrics/MethodLength:
23
28
  Exclude:
24
29
  - spec/**/*
30
+ - rakelib/parsers/**/*
31
+
32
+ Metrics/AbcSize:
33
+ Exclude:
34
+ - rakelib/parsers/**/*
35
+
36
+ Metrics/CyclomaticComplexity:
37
+ Exclude:
38
+ - rakelib/parsers/**/*
39
+
40
+ Metrics/PerceivedComplexity:
41
+ Exclude:
42
+ - rakelib/parsers/**/*
25
43
 
26
44
  Layout/LineLength:
27
45
  Max: 120
28
46
 
29
47
  RSpec/MultipleMemoizedHelpers:
30
48
  Enabled: false
49
+
31
50
  RSpec/NestedGroups:
32
51
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.5.0
4
+
5
+ ### Added
6
+
7
+ - Docs parsers for types and methods
8
+ - [Bot API 9.2](https://core.telegram.org/bots/api-changelog#august-15-2025) [#325](https://github.com/atipugin/telegram-bot-ruby/pull/325)
9
+
3
10
  ## 2.4.0
4
11
 
5
12
  ### Added
@@ -9,119 +9,159 @@ module Telegram
9
9
  'deleteWebhook' => Types::Bool,
10
10
  'getWebhookInfo' => Types::WebhookInfo,
11
11
  'getMe' => Types::User,
12
+ 'logOut' => Types::Bool,
13
+ 'close' => Types::Bool,
12
14
  'sendMessage' => Types::Message,
13
15
  'forwardMessage' => Types::Message,
14
16
  'forwardMessages' => Types::Array.of(Types::MessageId),
17
+ 'copyMessage' => Types::MessageId,
18
+ 'copyMessages' => Types::Array.of(Types::MessageId),
15
19
  'sendPhoto' => Types::Message,
16
20
  'sendAudio' => Types::Message,
17
21
  'sendDocument' => Types::Message,
18
22
  'sendVideo' => Types::Message,
23
+ 'sendAnimation' => Types::Message,
19
24
  'sendVoice' => Types::Message,
20
25
  'sendVideoNote' => Types::Message,
26
+ 'sendPaidMedia' => Types::Message,
21
27
  'sendMediaGroup' => Types::Array.of(Types::Message),
22
28
  'sendLocation' => Types::Message,
23
- 'editMessageLiveLocation' => Types::Message | Types::Bool,
24
- 'stopMessageLiveLocation' => Types::Message | Types::Bool,
25
29
  'sendVenue' => Types::Message,
26
30
  'sendContact' => Types::Message,
31
+ 'sendPoll' => Types::Message,
32
+ 'sendChecklist' => Types::Message,
33
+ 'sendDice' => Types::Message,
27
34
  'sendChatAction' => Types::Bool,
28
35
  'setMessageReaction' => Types::Bool,
29
36
  'getUserProfilePhotos' => Types::UserProfilePhotos,
37
+ 'setUserEmojiStatus' => Types::Bool,
30
38
  'getFile' => Types::File,
31
39
  'banChatMember' => Types::Bool,
32
40
  'unbanChatMember' => Types::Bool,
33
41
  'restrictChatMember' => Types::Bool,
34
42
  'promoteChatMember' => Types::Bool,
35
- 'leaveChat' => Types::Bool,
36
- 'getChat' => Types::ChatFullInfo,
37
- 'getChatAdministrators' => Types::Array.of(Types::ChatMember),
43
+ 'setChatAdministratorCustomTitle' => Types::Bool,
44
+ 'banChatSenderChat' => Types::Bool,
45
+ 'unbanChatSenderChat' => Types::Bool,
46
+ 'setChatPermissions' => Types::Bool,
38
47
  'exportChatInviteLink' => Types::String,
48
+ 'createChatInviteLink' => Types::ChatInviteLink,
49
+ 'editChatInviteLink' => Types::ChatInviteLink,
50
+ 'createChatSubscriptionInviteLink' => Types::ChatInviteLink,
51
+ 'editChatSubscriptionInviteLink' => Types::ChatInviteLink,
52
+ 'revokeChatInviteLink' => Types::ChatInviteLink,
53
+ 'approveChatJoinRequest' => Types::Bool,
54
+ 'declineChatJoinRequest' => Types::Bool,
39
55
  'setChatPhoto' => Types::Bool,
40
56
  'deleteChatPhoto' => Types::Bool,
41
57
  'setChatTitle' => Types::Bool,
42
58
  'setChatDescription' => Types::Bool,
43
59
  'pinChatMessage' => Types::Bool,
44
60
  'unpinChatMessage' => Types::Bool,
45
- 'getChatMembersCount' => Types::Integer,
61
+ 'unpinAllChatMessages' => Types::Bool,
62
+ 'leaveChat' => Types::Bool,
63
+ 'getChat' => Types::ChatFullInfo,
64
+ 'getChatAdministrators' => Types::Array.of(Types::ChatMember),
65
+ 'getChatMemberCount' => Types::Integer,
46
66
  'getChatMember' => Types::ChatMember,
47
67
  'setChatStickerSet' => Types::Bool,
48
68
  'deleteChatStickerSet' => Types::Bool,
69
+ 'getForumTopicIconStickers' => Types::Array.of(Types::Sticker),
70
+ 'createForumTopic' => Types::ForumTopic,
71
+ 'editForumTopic' => Types::Bool,
72
+ 'closeForumTopic' => Types::Bool,
73
+ 'reopenForumTopic' => Types::Bool,
74
+ 'deleteForumTopic' => Types::Bool,
75
+ 'unpinAllForumTopicMessages' => Types::Bool,
76
+ 'editGeneralForumTopic' => Types::Bool,
77
+ 'closeGeneralForumTopic' => Types::Bool,
78
+ 'reopenGeneralForumTopic' => Types::Bool,
79
+ 'hideGeneralForumTopic' => Types::Bool,
80
+ 'unhideGeneralForumTopic' => Types::Bool,
81
+ 'unpinAllGeneralForumTopicMessages' => Types::Bool,
49
82
  'answerCallbackQuery' => Types::Bool,
50
83
  'getUserChatBoosts' => Types::UserChatBoosts,
84
+ 'getBusinessConnection' => Types::BusinessConnection,
85
+ 'setMyCommands' => Types::Bool,
86
+ 'deleteMyCommands' => Types::Bool,
87
+ 'getMyCommands' => Types::Array.of(Types::BotCommand),
88
+ 'setMyName' => Types::Bool,
89
+ 'getMyName' => Types::BotName,
90
+ 'setMyDescription' => Types::Bool,
91
+ 'getMyDescription' => Types::BotDescription,
92
+ 'setMyShortDescription' => Types::Bool,
93
+ 'getMyShortDescription' => Types::BotShortDescription,
94
+ 'setChatMenuButton' => Types::Bool,
95
+ 'getChatMenuButton' => Types::MenuButton,
96
+ 'setMyDefaultAdministratorRights' => Types::Bool,
97
+ 'getMyDefaultAdministratorRights' => Types::ChatAdministratorRights,
98
+ 'getAvailableGifts' => Types::Gifts,
99
+ 'sendGift' => Types::Bool,
100
+ 'giftPremiumSubscription' => Types::Bool,
101
+ 'verifyUser' => Types::Bool,
102
+ 'verifyChat' => Types::Bool,
103
+ 'removeUserVerification' => Types::Bool,
104
+ 'removeChatVerification' => Types::Bool,
105
+ 'readBusinessMessage' => Types::Bool,
106
+ 'deleteBusinessMessages' => Types::Bool,
107
+ 'setBusinessAccountName' => Types::Bool,
108
+ 'setBusinessAccountUsername' => Types::Bool,
109
+ 'setBusinessAccountBio' => Types::Bool,
110
+ 'setBusinessAccountProfilePhoto' => Types::Bool,
111
+ 'removeBusinessAccountProfilePhoto' => Types::Bool,
112
+ 'setBusinessAccountGiftSettings' => Types::Bool,
113
+ 'getBusinessAccountStarBalance' => Types::StarAmount,
114
+ 'transferBusinessAccountStars' => Types::Bool,
115
+ 'getBusinessAccountGifts' => Types::OwnedGifts,
116
+ 'convertGiftToStars' => Types::Bool,
117
+ 'upgradeGift' => Types::Bool,
118
+ 'transferGift' => Types::Bool,
119
+ 'postStory' => Types::Story,
120
+ 'editStory' => Types::Story,
121
+ 'deleteStory' => Types::Bool,
51
122
  'editMessageText' => Types::Message | Types::Bool,
52
123
  'editMessageCaption' => Types::Message | Types::Bool,
124
+ 'editMessageMedia' => Types::Message | Types::Bool,
125
+ 'editMessageLiveLocation' => Types::Message | Types::Bool,
126
+ 'stopMessageLiveLocation' => Types::Message | Types::Bool,
127
+ 'editMessageChecklist' => Types::Message,
53
128
  'editMessageReplyMarkup' => Types::Message | Types::Bool,
129
+ 'stopPoll' => Types::Poll,
130
+ 'approveSuggestedPost' => Types::Bool,
131
+ 'declineSuggestedPost' => Types::Bool,
54
132
  'deleteMessage' => Types::Bool,
55
133
  'deleteMessages' => Types::Bool,
56
134
  'sendSticker' => Types::Message,
57
135
  'getStickerSet' => Types::StickerSet,
136
+ 'getCustomEmojiStickers' => Types::Array.of(Types::Sticker),
58
137
  'uploadStickerFile' => Types::File,
59
138
  'createNewStickerSet' => Types::Bool,
60
139
  'addStickerToSet' => Types::Bool,
61
140
  'setStickerPositionInSet' => Types::Bool,
62
141
  'deleteStickerFromSet' => Types::Bool,
142
+ 'replaceStickerInSet' => Types::Bool,
143
+ 'setStickerEmojiList' => Types::Bool,
144
+ 'setStickerKeywords' => Types::Bool,
145
+ 'setStickerMaskPosition' => Types::Bool,
146
+ 'setStickerSetTitle' => Types::Bool,
147
+ 'setStickerSetThumbnail' => Types::Bool,
148
+ 'setCustomEmojiStickerSetThumbnail' => Types::Bool,
149
+ 'deleteStickerSet' => Types::Bool,
63
150
  'answerInlineQuery' => Types::Bool,
151
+ 'answerWebAppQuery' => Types::SentWebAppMessage,
152
+ 'savePreparedInlineMessage' => Types::PreparedInlineMessage,
64
153
  'sendInvoice' => Types::Message,
154
+ 'createInvoiceLink' => Types::String,
65
155
  'answerShippingQuery' => Types::Bool,
66
156
  'answerPreCheckoutQuery' => Types::Bool,
67
- 'sendGame' => Types::Message,
68
- 'setGameScore' => Types::Message | Types::Bool,
69
- 'getGameHighScores' => Types::Array.of(Types::GameHighScore),
70
- 'setPassportDataErrors' => Types::Bool,
71
- 'editMessageMedia' => Types::Message | Types::Bool,
72
- 'sendAnimation' => Types::Message,
73
- 'sendPoll' => Types::Message,
74
- 'stopPoll' => Types::Poll,
75
- 'setChatPermissions' => Types::Bool,
76
- 'setChatAdministratorCustomTitle' => Types::Bool,
77
- 'sendDice' => Types::Message,
78
- 'getMyCommands' => Types::Array.of(Types::BotCommand),
79
- 'setMyCommands' => Types::Bool,
80
- 'deleteMyCommands' => Types::Bool,
81
- 'setStickerSetThumbnail' => Types::Bool,
82
- 'logOut' => Types::Bool,
83
- 'close' => Types::Bool,
84
- 'copyMessage' => Types::MessageId,
85
- 'copyMessages' => Types::Array.of(Types::MessageId),
86
- 'createChatInviteLink' => Types::ChatInviteLink,
87
- 'editChatInviteLink' => Types::ChatInviteLink,
88
- 'revokeChatInviteLink' => Types::ChatInviteLink,
89
- 'approveChatJoinRequest' => Types::Bool,
90
- 'declineChatJoinRequest' => Types::Bool,
91
- 'banChatSenderChat' => Types::Bool,
92
- 'unbanChatSenderChat' => Types::Bool,
93
- 'answerWebAppQuery' => Types::SentWebAppMessage,
94
- 'setChatMenuButton' => Types::Bool,
95
- 'getChatMenuButton' => Types::MenuButtonDefault | Types::MenuButtonCommands | Types::MenuButtonWebApp,
96
- 'setMyDefaultAdministratorRights' => Types::Bool,
97
- 'getMyDefaultAdministratorRights' => Types::ChatAdministratorRights,
98
- 'createInvoiceLink' => Types::String,
99
- 'editGeneralForumTopic' => Types::Bool,
100
- 'closeGeneralForumTopic' => Types::Bool,
101
- 'reopenGeneralForumTopic' => Types::Bool,
102
- 'hideGeneralForumTopic' => Types::Bool,
103
- 'unhideGeneralForumTopic' => Types::Bool,
104
- 'unpinAllGeneralForumTopicMessages' => Types::Bool,
105
- 'setMyName' => Types::Bool,
106
- 'getMyName' => Types::BotName,
107
- 'setMyDescription' => Types::Bool,
108
- 'getMyDescription' => Types::BotDescription,
109
- 'setMyShortDescription' => Types::Bool,
110
- 'getMyShortDescription' => Types::BotShortDescription,
111
- 'refundStarPayment' => Types::Bool,
157
+ 'getMyStarBalance' => Types::StarAmount,
112
158
  'getStarTransactions' => Types::StarTransactions,
113
- 'sendPaidMedia' => Types::Message,
114
- 'createChatSubscriptionInviteLink' => Types::ChatInviteLink,
115
- 'editChatSubscriptionInviteLink' => Types::ChatInviteLink,
116
- 'getAvailableGifts' => Types::Gifts,
117
- 'sendGift' => Types::Bool,
118
- 'savePreparedInlineMessage' => Types::PreparedInlineMessage,
159
+ 'refundStarPayment' => Types::Bool,
119
160
  'editUserStarSubscription' => Types::Bool,
120
- 'setUserEmojiStatus' => Types::Bool,
121
- 'verifyUser' => Types::Bool,
122
- 'verifyChat' => Types::Bool,
123
- 'removeUserVerification' => Types::Bool,
124
- 'removeChatVerification' => Types::Bool
161
+ 'setPassportDataErrors' => Types::Bool,
162
+ 'sendGame' => Types::Message,
163
+ 'setGameScore' => Types::Message | Types::Bool,
164
+ 'getGameHighScores' => Types::Array.of(Types::GameHighScore)
125
165
  }.freeze
126
166
  end
127
167
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class AcceptedGiftTypes < Base
7
+ attribute :unlimited_gifts, Types::Bool
8
+ attribute :limited_gifts, Types::Bool
9
+ attribute :unique_gifts, Types::Bool
10
+ attribute :premium_subscription, Types::Bool
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class BusinessBotRights < Base
7
+ attribute? :can_reply, Types::True
8
+ attribute? :can_read_messages, Types::True
9
+ attribute? :can_delete_sent_messages, Types::True
10
+ attribute? :can_delete_all_messages, Types::True
11
+ attribute? :can_edit_name, Types::True
12
+ attribute? :can_edit_bio, Types::True
13
+ attribute? :can_edit_profile_photo, Types::True
14
+ attribute? :can_edit_username, Types::True
15
+ attribute? :can_change_gift_settings, Types::True
16
+ attribute? :can_view_gifts_and_stars, Types::True
17
+ attribute? :can_convert_gifts_to_stars, Types::True
18
+ attribute? :can_transfer_and_upgrade_gifts, Types::True
19
+ attribute? :can_transfer_stars, Types::True
20
+ attribute? :can_manage_stories, Types::True
21
+ end
22
+ end
23
+ end
24
+ end
@@ -8,7 +8,7 @@ module Telegram
8
8
  attribute :user, User
9
9
  attribute :user_chat_id, Types::Integer
10
10
  attribute :date, Types::Integer
11
- attribute :can_reply, Types::Bool
11
+ attribute? :rights, BusinessBotRights
12
12
  attribute :is_enabled, Types::Bool
13
13
  end
14
14
  end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :first_name, Types::String
12
12
  attribute? :last_name, Types::String
13
13
  attribute? :is_forum, Types::True
14
+ attribute? :is_direct_messages, Types::True
14
15
  end
15
16
  end
16
17
  end
@@ -19,6 +19,7 @@ module Telegram
19
19
  attribute? :can_edit_messages, Types::Bool
20
20
  attribute? :can_pin_messages, Types::Bool
21
21
  attribute? :can_manage_topics, Types::Bool
22
+ attribute? :can_manage_direct_messages, Types::Bool
22
23
  end
23
24
  end
24
25
  end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :first_name, Types::String
12
12
  attribute? :last_name, Types::String
13
13
  attribute? :is_forum, Types::True
14
+ attribute? :is_direct_messages, Types::True
14
15
  attribute :accent_color_id, Types::Integer
15
16
  attribute :max_reaction_count, Types::Integer
16
17
  attribute? :photo, ChatPhoto
@@ -20,6 +21,7 @@ module Telegram
20
21
  attribute? :business_location, BusinessLocation
21
22
  attribute? :business_opening_hours, BusinessOpeningHours
22
23
  attribute? :personal_chat, Chat
24
+ attribute? :parent_chat, Chat
23
25
  attribute? :available_reactions, Types::Array.of(ReactionType)
24
26
  attribute? :background_custom_emoji_id, Types::String
25
27
  attribute? :profile_accent_color_id, Types::Integer
@@ -35,7 +37,7 @@ module Telegram
35
37
  attribute? :invite_link, Types::String
36
38
  attribute? :pinned_message, Message
37
39
  attribute? :permissions, ChatPermissions
38
- attribute? :can_send_gift, Types::True
40
+ attribute :accepted_gift_types, AcceptedGiftTypes
39
41
  attribute? :can_send_paid_media, Types::True
40
42
  attribute? :slow_mode_delay, Types::Integer
41
43
  attribute? :unrestrict_boost_count, Types::Integer
@@ -22,6 +22,7 @@ module Telegram
22
22
  attribute? :can_edit_messages, Types::Bool
23
23
  attribute? :can_pin_messages, Types::Bool
24
24
  attribute? :can_manage_topics, Types::Bool
25
+ attribute? :can_manage_direct_messages, Types::Bool
25
26
  attribute? :custom_title, Types::String
26
27
  end
27
28
  end
@@ -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,15 @@
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? :completion_date, Types::Integer
12
+ end
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 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
@@ -10,6 +10,7 @@ module Telegram
10
10
  attribute? :upgrade_star_count, Types::Integer
11
11
  attribute? :total_count, Types::Integer
12
12
  attribute? :remaining_count, Types::Integer
13
+ attribute? :publisher_chat, Chat
13
14
  end
14
15
  end
15
16
  end
@@ -0,0 +1,18 @@
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? :can_be_upgraded, Types::True
12
+ attribute? :text, Types::String
13
+ attribute? :entities, Types::Array.of(MessageEntity)
14
+ attribute? :is_private, Types::True
15
+ end
16
+ end
17
+ end
18
+ end
@@ -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