telegram-bot 0.16.5 → 0.16.7
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/bin/fetch-telegram-methods +21 -0
- data/lib/tasks/telegram-bot.rake +3 -0
- data/lib/telegram/bot/client/api_methods.txt +5 -1
- data/lib/telegram/bot/updates_controller/payload_types.txt +25 -0
- data/lib/telegram/bot/updates_controller.rb +7 -25
- data/lib/telegram/bot/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34995d74c520f8eae70916aeb0275f4a497efb3acdbd646deff9a3f958a68091
|
4
|
+
data.tar.gz: 9435155f30d6b38fd104014186724882800dd427d50511bb8ad6918da061a278
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34010573106a018e76e7818206b5105a87df55fb3e937a7d1ddae9e6a25a21ed542a30bf06b9e808dccb21c2bb99f5ef07e4aff5e2666baad416836e29b07755
|
7
|
+
data.tar.gz: 830516cb35cf2779bff8b8538d2bc9c9e481ce43437f5b32c4be6ac56eea55382354a98983be3aab12987868197e3a2eb66040a5e69d224f8dcabdc2e9c8d07b
|
data/CHANGELOG.md
CHANGED
data/bin/fetch-telegram-methods
CHANGED
@@ -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}"
|
data/lib/tasks/telegram-bot.rake
CHANGED
@@ -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.
|
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
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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.
|
data/lib/telegram/bot/version.rb
CHANGED
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.
|
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:
|
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
|