telegram-bot-ruby 1.0.0.rc1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +10 -0
  3. data/.github/workflows/ci.yml +2 -5
  4. data/.github/workflows/stale.yml +19 -0
  5. data/.gitignore +1 -0
  6. data/.rspec +1 -0
  7. data/.rubocop.yml +12 -7
  8. data/CHANGELOG.md +17 -0
  9. data/Gemfile +13 -0
  10. data/LICENSE +0 -1
  11. data/README.md +78 -19
  12. data/Rakefile +10 -8
  13. data/bin/console +4 -1
  14. data/lib/telegram/bot/api/endpoints.rb +114 -0
  15. data/lib/telegram/bot/api.rb +20 -44
  16. data/lib/telegram/bot/client.rb +8 -9
  17. data/lib/telegram/bot/exceptions/response_error.rb +2 -8
  18. data/lib/telegram/bot/types/animation.rb +1 -1
  19. data/lib/telegram/bot/types/audio.rb +1 -1
  20. data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +1 -1
  21. data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +1 -1
  22. data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +1 -1
  23. data/lib/telegram/bot/types/bot_command_scope_chat.rb +2 -2
  24. data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +2 -2
  25. data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +2 -2
  26. data/lib/telegram/bot/types/bot_command_scope_default.rb +1 -1
  27. data/lib/telegram/bot/types/bot_description.rb +11 -0
  28. data/lib/telegram/bot/types/bot_name.rb +11 -0
  29. data/lib/telegram/bot/types/bot_short_description.rb +11 -0
  30. data/lib/telegram/bot/types/callback_query.rb +1 -1
  31. data/lib/telegram/bot/types/chat.rb +16 -9
  32. data/lib/telegram/bot/types/chat_administrator_rights.rb +3 -0
  33. data/lib/telegram/bot/types/chat_boost.rb +14 -0
  34. data/lib/telegram/bot/types/chat_boost_removed.rb +14 -0
  35. data/lib/telegram/bot/types/chat_boost_source.rb +13 -0
  36. data/lib/telegram/bot/types/chat_boost_source_gift_code.rb +12 -0
  37. data/lib/telegram/bot/types/chat_boost_source_giveaway.rb +14 -0
  38. data/lib/telegram/bot/types/chat_boost_source_premium.rb +12 -0
  39. data/lib/telegram/bot/types/chat_boost_updated.rb +12 -0
  40. data/lib/telegram/bot/types/chat_join_request.rb +1 -0
  41. data/lib/telegram/bot/types/chat_member.rb +11 -2
  42. data/lib/telegram/bot/types/chat_member_administrator.rb +8 -5
  43. data/lib/telegram/bot/types/chat_member_banned.rb +2 -2
  44. data/lib/telegram/bot/types/chat_member_left.rb +2 -2
  45. data/lib/telegram/bot/types/chat_member_member.rb +2 -2
  46. data/lib/telegram/bot/types/chat_member_owner.rb +2 -2
  47. data/lib/telegram/bot/types/chat_member_restricted.rb +12 -7
  48. data/lib/telegram/bot/types/chat_member_updated.rb +1 -0
  49. data/lib/telegram/bot/types/chat_permissions.rb +6 -1
  50. data/lib/telegram/bot/types/chat_shared.rb +12 -0
  51. data/lib/telegram/bot/types/compactable.rb +2 -7
  52. data/lib/telegram/bot/types/document.rb +1 -1
  53. data/lib/telegram/bot/types/external_reply_info.rb +33 -0
  54. data/lib/telegram/bot/types/force_reply.rb +1 -1
  55. data/lib/telegram/bot/types/giveaway.rb +18 -0
  56. data/lib/telegram/bot/types/giveaway_completed.rb +13 -0
  57. data/lib/telegram/bot/types/giveaway_created.rb +10 -0
  58. data/lib/telegram/bot/types/giveaway_winners.rb +21 -0
  59. data/lib/telegram/bot/types/inaccessible_message.rb +13 -0
  60. data/lib/telegram/bot/types/inline_keyboard_button.rb +1 -0
  61. data/lib/telegram/bot/types/inline_query_result_article.rb +4 -4
  62. data/lib/telegram/bot/types/inline_query_result_audio.rb +1 -1
  63. data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +1 -1
  64. data/lib/telegram/bot/types/inline_query_result_cached_document.rb +1 -1
  65. data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +1 -1
  66. data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +1 -1
  67. data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +1 -1
  68. data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +1 -1
  69. data/lib/telegram/bot/types/inline_query_result_cached_video.rb +1 -1
  70. data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +1 -1
  71. data/lib/telegram/bot/types/inline_query_result_contact.rb +4 -4
  72. data/lib/telegram/bot/types/inline_query_result_document.rb +4 -4
  73. data/lib/telegram/bot/types/inline_query_result_game.rb +1 -1
  74. data/lib/telegram/bot/types/inline_query_result_gif.rb +3 -3
  75. data/lib/telegram/bot/types/inline_query_result_location.rb +4 -4
  76. data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +3 -3
  77. data/lib/telegram/bot/types/inline_query_result_photo.rb +2 -2
  78. data/lib/telegram/bot/types/inline_query_result_venue.rb +4 -4
  79. data/lib/telegram/bot/types/inline_query_result_video.rb +2 -2
  80. data/lib/telegram/bot/types/inline_query_result_voice.rb +1 -1
  81. data/lib/telegram/bot/types/input_media_animation.rb +2 -2
  82. data/lib/telegram/bot/types/input_media_audio.rb +2 -2
  83. data/lib/telegram/bot/types/input_media_document.rb +2 -2
  84. data/lib/telegram/bot/types/input_media_photo.rb +1 -1
  85. data/lib/telegram/bot/types/input_media_video.rb +2 -2
  86. data/lib/telegram/bot/types/input_text_message_content.rb +1 -1
  87. data/lib/telegram/bot/types/keyboard_button.rb +2 -0
  88. data/lib/telegram/bot/types/keyboard_button_request_chat.rb +18 -0
  89. data/lib/telegram/bot/types/keyboard_button_request_users.rb +14 -0
  90. data/lib/telegram/bot/types/link_preview_options.rb +15 -0
  91. data/lib/telegram/bot/types/maybe_inaccessible_message.rb +12 -0
  92. data/lib/telegram/bot/types/menu_button_commands.rb +1 -1
  93. data/lib/telegram/bot/types/menu_button_default.rb +1 -1
  94. data/lib/telegram/bot/types/menu_button_web_app.rb +1 -1
  95. data/lib/telegram/bot/types/message.rb +20 -15
  96. data/lib/telegram/bot/types/message_id.rb +11 -0
  97. data/lib/telegram/bot/types/message_origin.rb +14 -0
  98. data/lib/telegram/bot/types/message_origin_channel.rb +15 -0
  99. data/lib/telegram/bot/types/message_origin_chat.rb +14 -0
  100. data/lib/telegram/bot/types/message_origin_hidden_user.rb +13 -0
  101. data/lib/telegram/bot/types/message_origin_user.rb +13 -0
  102. data/lib/telegram/bot/types/message_reaction_count_updated.rb +14 -0
  103. data/lib/telegram/bot/types/message_reaction_updated.rb +17 -0
  104. data/lib/telegram/bot/types/passport_element_error_data_field.rb +1 -1
  105. data/lib/telegram/bot/types/passport_element_error_file.rb +1 -1
  106. data/lib/telegram/bot/types/passport_element_error_files.rb +2 -2
  107. data/lib/telegram/bot/types/passport_element_error_front_side.rb +1 -1
  108. data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +1 -1
  109. data/lib/telegram/bot/types/passport_element_error_selfie.rb +1 -1
  110. data/lib/telegram/bot/types/passport_element_error_translation_file.rb +1 -1
  111. data/lib/telegram/bot/types/passport_element_error_translation_files.rb +2 -2
  112. data/lib/telegram/bot/types/passport_element_error_unspecified.rb +1 -1
  113. data/lib/telegram/bot/types/poll_answer.rb +2 -1
  114. data/lib/telegram/bot/types/reaction_count.rb +12 -0
  115. data/lib/telegram/bot/types/reaction_type.rb +12 -0
  116. data/lib/telegram/bot/types/reaction_type_custom_emoji.rb +12 -0
  117. data/lib/telegram/bot/types/reaction_type_emoji.rb +12 -0
  118. data/lib/telegram/bot/types/reply_keyboard_remove.rb +1 -1
  119. data/lib/telegram/bot/types/reply_parameters.rb +17 -0
  120. data/lib/telegram/bot/types/sticker.rb +2 -1
  121. data/lib/telegram/bot/types/sticker_set.rb +1 -1
  122. data/lib/telegram/bot/types/story.rb +9 -0
  123. data/lib/telegram/bot/types/switch_inline_query_chosen_chat.rb +15 -0
  124. data/lib/telegram/bot/types/text_quote.rb +14 -0
  125. data/lib/telegram/bot/types/update.rb +4 -0
  126. data/lib/telegram/bot/types/user.rb +2 -2
  127. data/lib/telegram/bot/types/user_chat_boosts.rb +11 -0
  128. data/lib/telegram/bot/types/users_shared.rb +12 -0
  129. data/lib/telegram/bot/types/video.rb +1 -1
  130. data/lib/telegram/bot/types/video_note.rb +1 -1
  131. data/lib/telegram/bot/types/webhook_info.rb +1 -1
  132. data/lib/telegram/bot/types/write_access_allowed.rb +3 -0
  133. data/lib/telegram/bot/version.rb +1 -1
  134. data/lib/telegram/bot.rb +1 -0
  135. data/telegram-bot-ruby.gemspec +1 -13
  136. metadata +47 -117
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tipugin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-02 00:00:00.000000000 Z
11
+ date: 2024-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -66,118 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.6'
69
- - !ruby/object:Gem::Dependency
70
- name: dotenv
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '2.8'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '2.8'
83
- - !ruby/object:Gem::Dependency
84
- name: nokogiri
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.13'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.13'
97
- - !ruby/object:Gem::Dependency
98
- name: pry
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rake
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '13.0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '13.0'
125
- - !ruby/object:Gem::Dependency
126
- name: rspec
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '3.4'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '3.4'
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '1.27'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '1.27'
153
- - !ruby/object:Gem::Dependency
154
- name: rubocop-rake
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: rubocop-rspec
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '2.10'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '2.10'
181
69
  description:
182
70
  email:
183
71
  - atipugin@gmail.com
@@ -185,8 +73,10 @@ executables: []
185
73
  extensions: []
186
74
  extra_rdoc_files: []
187
75
  files:
76
+ - ".editorconfig"
188
77
  - ".env.sample"
189
78
  - ".github/workflows/ci.yml"
79
+ - ".github/workflows/stale.yml"
190
80
  - ".gitignore"
191
81
  - ".rspec"
192
82
  - ".rubocop.yml"
@@ -200,6 +90,7 @@ files:
200
90
  - examples/bot.rb
201
91
  - lib/telegram/bot.rb
202
92
  - lib/telegram/bot/api.rb
93
+ - lib/telegram/bot/api/endpoints.rb
203
94
  - lib/telegram/bot/client.rb
204
95
  - lib/telegram/bot/configuration.rb
205
96
  - lib/telegram/bot/exceptions/base.rb
@@ -217,10 +108,20 @@ files:
217
108
  - lib/telegram/bot/types/bot_command_scope_chat_administrators.rb
218
109
  - lib/telegram/bot/types/bot_command_scope_chat_member.rb
219
110
  - lib/telegram/bot/types/bot_command_scope_default.rb
111
+ - lib/telegram/bot/types/bot_description.rb
112
+ - lib/telegram/bot/types/bot_name.rb
113
+ - lib/telegram/bot/types/bot_short_description.rb
220
114
  - lib/telegram/bot/types/callback_game.rb
221
115
  - lib/telegram/bot/types/callback_query.rb
222
116
  - lib/telegram/bot/types/chat.rb
223
117
  - lib/telegram/bot/types/chat_administrator_rights.rb
118
+ - lib/telegram/bot/types/chat_boost.rb
119
+ - lib/telegram/bot/types/chat_boost_removed.rb
120
+ - lib/telegram/bot/types/chat_boost_source.rb
121
+ - lib/telegram/bot/types/chat_boost_source_gift_code.rb
122
+ - lib/telegram/bot/types/chat_boost_source_giveaway.rb
123
+ - lib/telegram/bot/types/chat_boost_source_premium.rb
124
+ - lib/telegram/bot/types/chat_boost_updated.rb
224
125
  - lib/telegram/bot/types/chat_invite_link.rb
225
126
  - lib/telegram/bot/types/chat_join_request.rb
226
127
  - lib/telegram/bot/types/chat_location.rb
@@ -234,6 +135,7 @@ files:
234
135
  - lib/telegram/bot/types/chat_member_updated.rb
235
136
  - lib/telegram/bot/types/chat_permissions.rb
236
137
  - lib/telegram/bot/types/chat_photo.rb
138
+ - lib/telegram/bot/types/chat_shared.rb
237
139
  - lib/telegram/bot/types/chosen_inline_result.rb
238
140
  - lib/telegram/bot/types/compactable.rb
239
141
  - lib/telegram/bot/types/contact.rb
@@ -241,6 +143,7 @@ files:
241
143
  - lib/telegram/bot/types/document.rb
242
144
  - lib/telegram/bot/types/encrypted_credentials.rb
243
145
  - lib/telegram/bot/types/encrypted_passport_element.rb
146
+ - lib/telegram/bot/types/external_reply_info.rb
244
147
  - lib/telegram/bot/types/file.rb
245
148
  - lib/telegram/bot/types/force_reply.rb
246
149
  - lib/telegram/bot/types/forum_topic.rb
@@ -252,6 +155,11 @@ files:
252
155
  - lib/telegram/bot/types/game_high_score.rb
253
156
  - lib/telegram/bot/types/general_forum_topic_hidden.rb
254
157
  - lib/telegram/bot/types/general_forum_topic_unhidden.rb
158
+ - lib/telegram/bot/types/giveaway.rb
159
+ - lib/telegram/bot/types/giveaway_completed.rb
160
+ - lib/telegram/bot/types/giveaway_created.rb
161
+ - lib/telegram/bot/types/giveaway_winners.rb
162
+ - lib/telegram/bot/types/inaccessible_message.rb
255
163
  - lib/telegram/bot/types/inline_keyboard_button.rb
256
164
  - lib/telegram/bot/types/inline_keyboard_markup.rb
257
165
  - lib/telegram/bot/types/inline_query.rb
@@ -289,16 +197,28 @@ files:
289
197
  - lib/telegram/bot/types/invoice.rb
290
198
  - lib/telegram/bot/types/keyboard_button.rb
291
199
  - lib/telegram/bot/types/keyboard_button_poll_type.rb
200
+ - lib/telegram/bot/types/keyboard_button_request_chat.rb
201
+ - lib/telegram/bot/types/keyboard_button_request_users.rb
292
202
  - lib/telegram/bot/types/labeled_price.rb
203
+ - lib/telegram/bot/types/link_preview_options.rb
293
204
  - lib/telegram/bot/types/location.rb
294
205
  - lib/telegram/bot/types/login_url.rb
295
206
  - lib/telegram/bot/types/mask_position.rb
207
+ - lib/telegram/bot/types/maybe_inaccessible_message.rb
296
208
  - lib/telegram/bot/types/menu_button_commands.rb
297
209
  - lib/telegram/bot/types/menu_button_default.rb
298
210
  - lib/telegram/bot/types/menu_button_web_app.rb
299
211
  - lib/telegram/bot/types/message.rb
300
212
  - lib/telegram/bot/types/message_auto_delete_timer_changed.rb
301
213
  - lib/telegram/bot/types/message_entity.rb
214
+ - lib/telegram/bot/types/message_id.rb
215
+ - lib/telegram/bot/types/message_origin.rb
216
+ - lib/telegram/bot/types/message_origin_channel.rb
217
+ - lib/telegram/bot/types/message_origin_chat.rb
218
+ - lib/telegram/bot/types/message_origin_hidden_user.rb
219
+ - lib/telegram/bot/types/message_origin_user.rb
220
+ - lib/telegram/bot/types/message_reaction_count_updated.rb
221
+ - lib/telegram/bot/types/message_reaction_updated.rb
302
222
  - lib/telegram/bot/types/order_info.rb
303
223
  - lib/telegram/bot/types/passport_data.rb
304
224
  - lib/telegram/bot/types/passport_element_error_data_field.rb
@@ -318,18 +238,28 @@ files:
318
238
  - lib/telegram/bot/types/poll_option.rb
319
239
  - lib/telegram/bot/types/pre_checkout_query.rb
320
240
  - lib/telegram/bot/types/proximity_alert_triggered.rb
241
+ - lib/telegram/bot/types/reaction_count.rb
242
+ - lib/telegram/bot/types/reaction_type.rb
243
+ - lib/telegram/bot/types/reaction_type_custom_emoji.rb
244
+ - lib/telegram/bot/types/reaction_type_emoji.rb
321
245
  - lib/telegram/bot/types/reply_keyboard_markup.rb
322
246
  - lib/telegram/bot/types/reply_keyboard_remove.rb
247
+ - lib/telegram/bot/types/reply_parameters.rb
323
248
  - lib/telegram/bot/types/sent_web_app_message.rb
324
249
  - lib/telegram/bot/types/shipping_address.rb
325
250
  - lib/telegram/bot/types/shipping_option.rb
326
251
  - lib/telegram/bot/types/shipping_query.rb
327
252
  - lib/telegram/bot/types/sticker.rb
328
253
  - lib/telegram/bot/types/sticker_set.rb
254
+ - lib/telegram/bot/types/story.rb
329
255
  - lib/telegram/bot/types/successful_payment.rb
256
+ - lib/telegram/bot/types/switch_inline_query_chosen_chat.rb
257
+ - lib/telegram/bot/types/text_quote.rb
330
258
  - lib/telegram/bot/types/update.rb
331
259
  - lib/telegram/bot/types/user.rb
260
+ - lib/telegram/bot/types/user_chat_boosts.rb
332
261
  - lib/telegram/bot/types/user_profile_photos.rb
262
+ - lib/telegram/bot/types/users_shared.rb
333
263
  - lib/telegram/bot/types/venue.rb
334
264
  - lib/telegram/bot/types/video.rb
335
265
  - lib/telegram/bot/types/video_chat_ended.rb
@@ -359,11 +289,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
359
289
  version: '2.7'
360
290
  required_rubygems_version: !ruby/object:Gem::Requirement
361
291
  requirements:
362
- - - ">"
292
+ - - ">="
363
293
  - !ruby/object:Gem::Version
364
- version: 1.3.1
294
+ version: '0'
365
295
  requirements: []
366
- rubygems_version: 3.4.1
296
+ rubygems_version: 3.5.5
367
297
  signing_key:
368
298
  specification_version: 4
369
299
  summary: Ruby wrapper for Telegram's Bot API