telegram-bot 0.16.5 → 0.16.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d432e15939fac4d32da35e08c6d8b48267cd28b3566ec9efdbe82691cfe196e3
4
- data.tar.gz: fb17a162ca307ae94552d6e7e1743e24dfab80ceb7cbacabde132bdf3808ac83
3
+ metadata.gz: 34995d74c520f8eae70916aeb0275f4a497efb3acdbd646deff9a3f958a68091
4
+ data.tar.gz: 9435155f30d6b38fd104014186724882800dd427d50511bb8ad6918da061a278
5
5
  SHA512:
6
- metadata.gz: '0991d40b759b4242572b762033e45572bea5845e3bc258f7463517903c8706156557c1ce4871d8c7a258cb03edb6eed8c387a7e0a036169e44f3adfd81a82eae'
7
- data.tar.gz: dad6c6119da067507d6d621c3784a214f796acb9e2ca4c595ba3deaa3fc0e080cc5cb194300420884398001831fef6a23a402a5f02e78ce652eac24f94c0187f
6
+ metadata.gz: 34010573106a018e76e7818206b5105a87df55fb3e937a7d1ddae9e6a25a21ed542a30bf06b9e808dccb21c2bb99f5ef07e4aff5e2666baad416836e29b07755
7
+ data.tar.gz: 830516cb35cf2779bff8b8538d2bc9c9e481ce43437f5b32c4be6ac56eea55382354a98983be3aab12987868197e3a2eb66040a5e69d224f8dcabdc2e9c8d07b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.16.7
4
+
5
+ - Update to Bot API 8.2
6
+
7
+ # 0.16.6
8
+
9
+ - Fix poller rake task for Rails 8.0
10
+
3
11
  # 0.16.5
4
12
 
5
13
  - Rails 8.0 support
@@ -41,3 +41,24 @@ puts result_txt
41
41
  API_METHODS_FILE = File.expand_path('../lib/telegram/bot/client/api_methods.txt', __dir__).freeze
42
42
  File.write(API_METHODS_FILE, result_txt)
43
43
  puts '', "Updated #{API_METHODS_FILE}"
44
+
45
+
46
+ puts '', 'Payload types:'
47
+ update_tbody = doc.css('tbody').
48
+ find { |tbody| tbody.css('td').any? { |td| td.text == 'update_id' } }
49
+ payload_types = update_tbody.css('td:first-child').map(&:text).reject { |x| x == 'update_id' }
50
+
51
+ result = ['# Generated with bin/fetch-telegram-methods']
52
+ result << "# #{api_version[1]}" if api_version
53
+ result << payload_types.join("\n")
54
+ result << ''
55
+ result_txt = result.join("\n")
56
+
57
+ puts result_txt
58
+
59
+ PAYLOAD_TYPES_FILE = File.expand_path(
60
+ '../lib/telegram/bot/updates_controller/payload_types.txt',
61
+ __dir__,
62
+ ).freeze
63
+ File.write(PAYLOAD_TYPES_FILE, result_txt)
64
+ puts '', "Updated #{PAYLOAD_TYPES_FILE}"
@@ -15,6 +15,9 @@ namespace :telegram do
15
15
  Rails.logger.extend ActiveSupport::Logger.broadcast console
16
16
  end
17
17
  end
18
+ # Routes are not loaded by default in Rails >= 8.0.
19
+ # Load them explicitly to identify a controller for a bot.
20
+ Rails.application.try(:reload_routes_unless_loaded)
18
21
  Telegram::Bot::UpdatesPoller.start(ENV['BOT']&.to_sym || :default)
19
22
  end
20
23
 
@@ -1,5 +1,5 @@
1
1
  # Generated with bin/fetch-telegram-methods
2
- # Bot API 8.0
2
+ # Bot API 8.2
3
3
 
4
4
  getUpdates
5
5
  setWebhook
@@ -121,6 +121,10 @@ setCustomEmojiStickerSetThumbnail
121
121
  deleteStickerSet
122
122
  getAvailableGifts
123
123
  sendGift
124
+ verifyUser
125
+ verifyChat
126
+ removeUserVerification
127
+ removeChatVerification
124
128
 
125
129
  answerInlineQuery
126
130
  answerWebAppQuery
@@ -0,0 +1,25 @@
1
+ # Generated with bin/fetch-telegram-methods
2
+ # Bot API 8.2
3
+ message
4
+ edited_message
5
+ channel_post
6
+ edited_channel_post
7
+ business_connection
8
+ business_message
9
+ edited_business_message
10
+ deleted_business_messages
11
+ message_reaction
12
+ message_reaction_count
13
+ inline_query
14
+ chosen_inline_result
15
+ callback_query
16
+ shipping_query
17
+ pre_checkout_query
18
+ purchased_paid_media
19
+ poll
20
+ poll_answer
21
+ my_chat_member
22
+ chat_member
23
+ chat_join_request
24
+ chat_boost
25
+ removed_chat_boost
@@ -89,31 +89,13 @@ module Telegram
89
89
 
90
90
  extend Session::ConfigMethods
91
91
 
92
- PAYLOAD_TYPES = Set.new(%w[
93
- message
94
- edited_message
95
- channel_post
96
- edited_channel_post
97
- business_connection
98
- business_message
99
- edited_business_message
100
- deleted_business_messages
101
- message_reaction
102
- message_reaction_count
103
- inline_query
104
- chosen_inline_result
105
- callback_query
106
- shipping_query
107
- pre_checkout_query
108
- purchased_paid_media
109
- poll
110
- poll_answer
111
- my_chat_member
112
- chat_member
113
- chat_join_request
114
- chat_boost
115
- removed_chat_boost
116
- ].freeze)
92
+ PAYLOAD_TYPES_FILE = File.expand_path('updates_controller/payload_types.txt', __dir__)
93
+ PAYLOAD_TYPES = File.read(PAYLOAD_TYPES_FILE).
94
+ lines.
95
+ map(&:strip).
96
+ reject { |x| x.empty? || x.start_with?('#') }.
97
+ to_set.
98
+ freeze
117
99
 
118
100
  class << self
119
101
  # Initialize controller and process update.
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Telegram
4
4
  module Bot
5
- VERSION = '0.16.5'
5
+ VERSION = '0.16.7'
6
6
 
7
7
  def self.gem_version
8
8
  Gem::Version.new VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.5
4
+ version: 0.16.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Melentiev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-28 00:00:00.000000000 Z
11
+ date: 2025-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -152,6 +152,7 @@ files:
152
152
  - lib/telegram/bot/updates_controller/instrumentation.rb
153
153
  - lib/telegram/bot/updates_controller/log_subscriber.rb
154
154
  - lib/telegram/bot/updates_controller/message_context.rb
155
+ - lib/telegram/bot/updates_controller/payload_types.txt
155
156
  - lib/telegram/bot/updates_controller/reply_helpers.rb
156
157
  - lib/telegram/bot/updates_controller/rescue.rb
157
158
  - lib/telegram/bot/updates_controller/rspec_helpers.rb