telegram-bot-ruby 2.5.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.
- checksums.yaml +4 -4
- data/.claude/skills/update-api/SKILL.md +70 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +9 -0
- data/README.md +40 -23
- data/lib/telegram/bot/api/endpoints.rb +8 -0
- data/lib/telegram/bot/api.rb +13 -1
- data/lib/telegram/bot/configuration.rb +2 -1
- data/lib/telegram/bot/types/accepted_gift_types.rb +1 -0
- data/lib/telegram/bot/types/callback_query.rb +4 -0
- data/lib/telegram/bot/types/chat_administrator_rights.rb +1 -0
- data/lib/telegram/bot/types/chat_full_info.rb +4 -0
- data/lib/telegram/bot/types/chat_member_administrator.rb +1 -0
- data/lib/telegram/bot/types/chat_member_member.rb +1 -0
- data/lib/telegram/bot/types/chat_member_restricted.rb +2 -0
- data/lib/telegram/bot/types/chat_owner_changed.rb +11 -0
- data/lib/telegram/bot/types/chat_owner_left.rb +11 -0
- data/lib/telegram/bot/types/chat_permissions.rb +1 -0
- data/lib/telegram/bot/types/checklist_task.rb +1 -0
- data/lib/telegram/bot/types/forum_topic.rb +1 -0
- data/lib/telegram/bot/types/forum_topic_created.rb +1 -0
- data/lib/telegram/bot/types/gift.rb +6 -0
- data/lib/telegram/bot/types/gift_background.rb +13 -0
- data/lib/telegram/bot/types/gift_info.rb +2 -0
- data/lib/telegram/bot/types/inline_keyboard_button.rb +2 -0
- data/lib/telegram/bot/types/keyboard_button.rb +2 -0
- data/lib/telegram/bot/types/message.rb +7 -1
- data/lib/telegram/bot/types/message_entity.rb +2 -0
- data/lib/telegram/bot/types/owned_gift_regular.rb +2 -0
- data/lib/telegram/bot/types/unique_gift.rb +5 -0
- data/lib/telegram/bot/types/unique_gift_colors.rb +16 -0
- data/lib/telegram/bot/types/unique_gift_info.rb +2 -1
- data/lib/telegram/bot/types/unique_gift_model.rb +1 -0
- data/lib/telegram/bot/types/user.rb +2 -0
- data/lib/telegram/bot/types/user_profile_audios.rb +12 -0
- data/lib/telegram/bot/types/user_rating.rb +14 -0
- data/lib/telegram/bot/types/video.rb +1 -0
- data/lib/telegram/bot/types/video_quality.rb +16 -0
- data/lib/telegram/bot/version.rb +1 -1
- metadata +9 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 357f5a74cde39f07315db2cd4235600f5e67a2aaa3fed93a8ad9d9fe87be3710
|
|
4
|
+
data.tar.gz: 041b6041f45a36d8a8e976f251449c5c70bfbf045c89e9c359955bcc45d08c45
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d248ef2b807c9d9a8b5192e10daf9c4bbbb881ca62caecf29189714636d264f9e2f0ef49533bf6e60eb26406e05ed1b6766dab99303e3595fdf1febe3000428f
|
|
7
|
+
data.tar.gz: 7974d0f32a1b1d4560db47212097358ddba3d5a2d13f2e596d9dff88e9aa3a0c3e1249574e4df5b3217da77a8a529a04bdf266e63d9f0285636bbd0327711809
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update-api
|
|
3
|
+
description: Parse Telegram Bot API docs and rebuild generated Ruby types and endpoints
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash, Read, Edit, Grep, WebFetch
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Update generated types and API endpoints from the latest Telegram Bot API documentation.
|
|
9
|
+
|
|
10
|
+
## Step 1: Check for updates
|
|
11
|
+
|
|
12
|
+
1. Fetch <https://core.telegram.org/bots/api-changelog> and identify the most recent Bot API version and all version entries listed.
|
|
13
|
+
2. Read `CHANGELOG.md` and find the highest Bot API version mentioned to determine which version this lib currently supports.
|
|
14
|
+
3. List all Bot API versions that are newer than the lib's current version, with a summary of changes for each.
|
|
15
|
+
4. If the lib is already up to date, stop here and inform the user.
|
|
16
|
+
|
|
17
|
+
## Step 2: Parse
|
|
18
|
+
|
|
19
|
+
Run both parse tasks to scrape the latest Telegram Bot API docs:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
bundle exec rake parse:types
|
|
23
|
+
bundle exec rake parse:methods
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Step 3: Rebuild
|
|
27
|
+
|
|
28
|
+
Before rebuilding, read the custom method files listed in Step 4 so you have a snapshot of their current content.
|
|
29
|
+
|
|
30
|
+
Regenerate Ruby source files from the parsed JSON data:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
bundle exec rake rebuild:types
|
|
34
|
+
bundle exec rake rebuild:methods
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Step 4: Restore custom methods
|
|
38
|
+
|
|
39
|
+
The rebuild overwrites type files from templates, losing hand-written methods. After rebuild, read each file below and restore the custom method if it's missing:
|
|
40
|
+
|
|
41
|
+
| File | Method to restore |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `lib/telegram/bot/types/callback_query.rb` | `def to_s` returning `data.to_s` |
|
|
44
|
+
| `lib/telegram/bot/types/message.rb` | `def to_s` returning `text.to_s` |
|
|
45
|
+
| `lib/telegram/bot/types/chosen_inline_result.rb` | `alias to_s query` |
|
|
46
|
+
| `lib/telegram/bot/types/inline_query.rb` | `alias to_s query` |
|
|
47
|
+
| `lib/telegram/bot/types/inline_keyboard_markup.rb` | `def to_compact_hash` that calls `to_compact_hash` on nested `InlineKeyboardButton` items |
|
|
48
|
+
| `lib/telegram/bot/types/reply_keyboard_markup.rb` | `def to_compact_hash` that calls `to_compact_hash` on nested `KeyboardButton` items |
|
|
49
|
+
| `lib/telegram/bot/types/update.rb` | `def current_message` that finds the first non-`update_id` attribute value |
|
|
50
|
+
|
|
51
|
+
For each file:
|
|
52
|
+
|
|
53
|
+
1. Read the current file content
|
|
54
|
+
2. Check if the custom method/alias is already present
|
|
55
|
+
3. If missing, add it back before the closing `end` of the class, with one blank line before it
|
|
56
|
+
|
|
57
|
+
## Step 5: Review changes
|
|
58
|
+
|
|
59
|
+
Run `git diff --stat` and then `git diff` to review all changes. Summarize what was added/modified/removed compared to the previous version.
|
|
60
|
+
|
|
61
|
+
## Step 6: Lint and test
|
|
62
|
+
|
|
63
|
+
Run linting and tests to verify everything is correct:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
bundle exec rubocop
|
|
67
|
+
bundle exec rake spec
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If rubocop or tests fail, fix the issues before finishing.
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.6.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- [Bot API 9.4](https://core.telegram.org/bots/api-changelog#february-9-2026) + [Bot API 9.5](https://core.telegram.org/bots/api-changelog#march-1-2026) [#334](https://github.com/atipugin/telegram-bot-ruby/pull/334)
|
|
8
|
+
- Support for configuring Faraday adapter options [#333](https://github.com/atipugin/telegram-bot-ruby/pull/333) (thx [@dmeremyanin](https://github.com/dmeremyanin))
|
|
9
|
+
- [Bot API 9.3](https://core.telegram.org/bots/api-changelog#december-31-2025) [#328](https://github.com/atipugin/telegram-bot-ruby/pull/328)
|
|
10
|
+
- `CallbackQuery#to_s` for improved logging [#327](https://github.com/atipugin/telegram-bot-ruby/pull/327) (thx [@projecteurlumiere](https://github.com/projecteurlumiere))
|
|
11
|
+
|
|
3
12
|
## 2.5.0
|
|
4
13
|
|
|
5
14
|
### Added
|
data/README.md
CHANGED
|
@@ -7,29 +7,12 @@ Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
|
|
|
7
7
|
[](https://codeclimate.com/github/atipugin/telegram-bot-ruby/maintainability)
|
|
8
8
|
[](https://saythanks.io/to/atipugin)
|
|
9
9
|
|
|
10
|
-
## 🚧 Upgrading to 1.0
|
|
11
|
-
|
|
12
|
-
Since v1.0 `telegram-bot-ruby` uses [`dry-struct`](https://github.com/dry-rb/dry-struct)
|
|
13
|
-
instead of [`virtus`](https://github.com/solnic/virtus).
|
|
14
|
-
This means that type objects are now immutable and you can't change them after initialization:
|
|
15
|
-
|
|
16
|
-
```ruby
|
|
17
|
-
# This won't work
|
|
18
|
-
kb = Telegram::Bot::Types::ReplyKeyboardRemove.new
|
|
19
|
-
kb.remove_keyboard = true
|
|
20
|
-
|
|
21
|
-
# You have to set attributes in constructor instead
|
|
22
|
-
kb = Telegram::Bot::Types::ReplyKeyboardRemove.new(remove_keyboard: true)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Please make sure it doesn't break your existing code before upgrading to 1.0.
|
|
26
|
-
|
|
27
10
|
## Installation
|
|
28
11
|
|
|
29
12
|
Add following line to your Gemfile:
|
|
30
13
|
|
|
31
14
|
```ruby
|
|
32
|
-
gem 'telegram-bot-ruby', '~> 2.
|
|
15
|
+
gem 'telegram-bot-ruby', '~> 2.5'
|
|
33
16
|
```
|
|
34
17
|
|
|
35
18
|
And then execute:
|
|
@@ -115,6 +98,16 @@ Telegram::Bot::Client.run(token, url: 'https://proxy.example.com') do |bot|
|
|
|
115
98
|
end
|
|
116
99
|
```
|
|
117
100
|
|
|
101
|
+
If you want to use a SOCKS5 proxy with the [Excon](https://github.com/excon/excon) adapter,
|
|
102
|
+
you can configure it like this:
|
|
103
|
+
|
|
104
|
+
```ruby
|
|
105
|
+
Telegram::Bot.configure do |config|
|
|
106
|
+
config.adapter = :excon
|
|
107
|
+
config.adapter_options = { socks5_proxy: 'socks5://socks.proxy:1080' }
|
|
108
|
+
end
|
|
109
|
+
```
|
|
110
|
+
|
|
118
111
|
## Custom keyboards
|
|
119
112
|
|
|
120
113
|
You can use your own [custom keyboards](https://core.telegram.org/bots#keyboards).
|
|
@@ -239,7 +232,7 @@ end
|
|
|
239
232
|
|
|
240
233
|
## Logging
|
|
241
234
|
|
|
242
|
-
By default, bot doesn't log anything (uses `
|
|
235
|
+
By default, bot doesn't log anything (uses `NullLogger`).
|
|
243
236
|
You can change this behavior and provide your own logger class.
|
|
244
237
|
See example below:
|
|
245
238
|
|
|
@@ -265,12 +258,36 @@ Telegram::Bot.configure do |config|
|
|
|
265
258
|
end
|
|
266
259
|
```
|
|
267
260
|
|
|
268
|
-
|
|
261
|
+
If your adapter supports additional configuration, you can pass options as a hash:
|
|
262
|
+
|
|
263
|
+
```ruby
|
|
264
|
+
Telegram::Bot.configure do |config|
|
|
265
|
+
config.adapter = :httpx
|
|
266
|
+
config.adapter_options = { persistent: false }
|
|
267
|
+
end
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Maintenance
|
|
271
|
+
|
|
272
|
+
This gem provides rake tasks to parse the official [Telegram Bot API documentation](https://core.telegram.org/bots/api) and regenerate types and API methods.
|
|
273
|
+
|
|
274
|
+
### Parsing
|
|
275
|
+
|
|
276
|
+
Parse types and methods from the official documentation:
|
|
277
|
+
|
|
278
|
+
```shell
|
|
279
|
+
rake parse:types # Parses types to data/types.json
|
|
280
|
+
rake parse:methods # Parses methods to data/methods.json
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Rebuilding
|
|
269
284
|
|
|
270
|
-
|
|
271
|
-
here are some boilerplates which can help you to start faster:
|
|
285
|
+
Regenerate Ruby code from the parsed JSON data:
|
|
272
286
|
|
|
273
|
-
|
|
287
|
+
```shell
|
|
288
|
+
rake rebuild:types # Rebuilds lib/telegram/bot/types/*.rb
|
|
289
|
+
rake rebuild:methods # Rebuilds lib/telegram/bot/api/endpoints.rb
|
|
290
|
+
```
|
|
274
291
|
|
|
275
292
|
## Contributing
|
|
276
293
|
|
|
@@ -31,9 +31,11 @@ module Telegram
|
|
|
31
31
|
'sendPoll' => Types::Message,
|
|
32
32
|
'sendChecklist' => Types::Message,
|
|
33
33
|
'sendDice' => Types::Message,
|
|
34
|
+
'sendMessageDraft' => Types::Bool,
|
|
34
35
|
'sendChatAction' => Types::Bool,
|
|
35
36
|
'setMessageReaction' => Types::Bool,
|
|
36
37
|
'getUserProfilePhotos' => Types::UserProfilePhotos,
|
|
38
|
+
'getUserProfileAudios' => Types::UserProfileAudios,
|
|
37
39
|
'setUserEmojiStatus' => Types::Bool,
|
|
38
40
|
'getFile' => Types::File,
|
|
39
41
|
'banChatMember' => Types::Bool,
|
|
@@ -41,6 +43,7 @@ module Telegram
|
|
|
41
43
|
'restrictChatMember' => Types::Bool,
|
|
42
44
|
'promoteChatMember' => Types::Bool,
|
|
43
45
|
'setChatAdministratorCustomTitle' => Types::Bool,
|
|
46
|
+
'setChatMemberTag' => Types::Bool,
|
|
44
47
|
'banChatSenderChat' => Types::Bool,
|
|
45
48
|
'unbanChatSenderChat' => Types::Bool,
|
|
46
49
|
'setChatPermissions' => Types::Bool,
|
|
@@ -91,6 +94,8 @@ module Telegram
|
|
|
91
94
|
'getMyDescription' => Types::BotDescription,
|
|
92
95
|
'setMyShortDescription' => Types::Bool,
|
|
93
96
|
'getMyShortDescription' => Types::BotShortDescription,
|
|
97
|
+
'setMyProfilePhoto' => Types::Bool,
|
|
98
|
+
'removeMyProfilePhoto' => Types::Bool,
|
|
94
99
|
'setChatMenuButton' => Types::Bool,
|
|
95
100
|
'getChatMenuButton' => Types::MenuButton,
|
|
96
101
|
'setMyDefaultAdministratorRights' => Types::Bool,
|
|
@@ -113,10 +118,13 @@ module Telegram
|
|
|
113
118
|
'getBusinessAccountStarBalance' => Types::StarAmount,
|
|
114
119
|
'transferBusinessAccountStars' => Types::Bool,
|
|
115
120
|
'getBusinessAccountGifts' => Types::OwnedGifts,
|
|
121
|
+
'getUserGifts' => Types::OwnedGifts,
|
|
122
|
+
'getChatGifts' => Types::OwnedGifts,
|
|
116
123
|
'convertGiftToStars' => Types::Bool,
|
|
117
124
|
'upgradeGift' => Types::Bool,
|
|
118
125
|
'transferGift' => Types::Bool,
|
|
119
126
|
'postStory' => Types::Story,
|
|
127
|
+
'repostStory' => Types::Story,
|
|
120
128
|
'editStory' => Types::Story,
|
|
121
129
|
'deleteStory' => Types::Bool,
|
|
122
130
|
'editMessageText' => Types::Message | Types::Bool,
|
data/lib/telegram/bot/api.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Telegram
|
|
|
15
15
|
@connection ||= Faraday.new(url: url) do |faraday|
|
|
16
16
|
faraday.request :multipart
|
|
17
17
|
faraday.request :url_encoded
|
|
18
|
-
faraday
|
|
18
|
+
configure_adapter(faraday)
|
|
19
19
|
faraday.options.timeout = Telegram::Bot.configuration.connection_timeout
|
|
20
20
|
faraday.options.open_timeout = Telegram::Bot.configuration.connection_open_timeout
|
|
21
21
|
end
|
|
@@ -52,6 +52,18 @@ module Telegram
|
|
|
52
52
|
|
|
53
53
|
private
|
|
54
54
|
|
|
55
|
+
def configure_adapter(faraday)
|
|
56
|
+
if adapter_options.empty?
|
|
57
|
+
faraday.adapter Telegram::Bot.configuration.adapter
|
|
58
|
+
else
|
|
59
|
+
faraday.adapter Telegram::Bot.configuration.adapter, **adapter_options
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def adapter_options
|
|
64
|
+
Telegram::Bot.configuration.adapter_options || {}
|
|
65
|
+
end
|
|
66
|
+
|
|
55
67
|
def build_params(params)
|
|
56
68
|
params.transform_values do |value|
|
|
57
69
|
sanitize_value(value)
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
module Telegram
|
|
4
4
|
module Bot
|
|
5
5
|
class Configuration
|
|
6
|
-
attr_accessor :adapter, :connection_open_timeout, :connection_timeout
|
|
6
|
+
attr_accessor :adapter, :adapter_options, :connection_open_timeout, :connection_timeout
|
|
7
7
|
|
|
8
8
|
def initialize
|
|
9
9
|
@adapter = Faraday.default_adapter
|
|
10
|
+
@adapter_options = nil
|
|
10
11
|
@connection_open_timeout = 20
|
|
11
12
|
@connection_timeout = 20
|
|
12
13
|
end
|
|
@@ -51,6 +51,10 @@ module Telegram
|
|
|
51
51
|
attribute? :custom_emoji_sticker_set_name, Types::String
|
|
52
52
|
attribute? :linked_chat_id, Types::Integer
|
|
53
53
|
attribute? :location, ChatLocation
|
|
54
|
+
attribute? :rating, UserRating
|
|
55
|
+
attribute? :first_profile_audio, Audio
|
|
56
|
+
attribute? :unique_gift_colors, UniqueGiftColors
|
|
57
|
+
attribute? :paid_message_star_count, Types::Integer
|
|
54
58
|
end
|
|
55
59
|
end
|
|
56
60
|
end
|
|
@@ -23,6 +23,7 @@ module Telegram
|
|
|
23
23
|
attribute? :can_pin_messages, Types::Bool
|
|
24
24
|
attribute? :can_manage_topics, Types::Bool
|
|
25
25
|
attribute? :can_manage_direct_messages, Types::Bool
|
|
26
|
+
attribute? :can_manage_tags, Types::Bool
|
|
26
27
|
attribute? :custom_title, Types::String
|
|
27
28
|
end
|
|
28
29
|
end
|
|
@@ -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
|
|
@@ -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
|
|
@@ -8,8 +8,14 @@ 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
|
|
13
19
|
attribute? :publisher_chat, Chat
|
|
14
20
|
end
|
|
15
21
|
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
|
|
@@ -8,10 +8,12 @@ module Telegram
|
|
|
8
8
|
attribute? :owned_gift_id, Types::String
|
|
9
9
|
attribute? :convert_star_count, Types::Integer
|
|
10
10
|
attribute? :prepaid_upgrade_star_count, Types::Integer
|
|
11
|
+
attribute? :is_upgrade_separate, Types::True
|
|
11
12
|
attribute? :can_be_upgraded, Types::True
|
|
12
13
|
attribute? :text, Types::String
|
|
13
14
|
attribute? :entities, Types::Array.of(MessageEntity)
|
|
14
15
|
attribute? :is_private, Types::True
|
|
16
|
+
attribute? :unique_gift_number, Types::Integer
|
|
15
17
|
end
|
|
16
18
|
end
|
|
17
19
|
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
|
|
@@ -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
|
|
@@ -11,6 +11,7 @@ module Telegram
|
|
|
11
11
|
attribute? :sender_chat, Chat
|
|
12
12
|
attribute? :sender_boost_count, Types::Integer
|
|
13
13
|
attribute? :sender_business_bot, User
|
|
14
|
+
attribute? :sender_tag, Types::String
|
|
14
15
|
attribute :date, Types::Integer
|
|
15
16
|
attribute? :business_connection_id, Types::String
|
|
16
17
|
attribute :chat, Chat
|
|
@@ -58,6 +59,8 @@ module Telegram
|
|
|
58
59
|
attribute? :location, Location
|
|
59
60
|
attribute? :new_chat_members, Types::Array.of(User)
|
|
60
61
|
attribute? :left_chat_member, User
|
|
62
|
+
attribute? :chat_owner_left, ChatOwnerLeft
|
|
63
|
+
attribute? :chat_owner_changed, ChatOwnerChanged
|
|
61
64
|
attribute? :new_chat_title, Types::String
|
|
62
65
|
attribute? :new_chat_photo, Types::Array.of(PhotoSize)
|
|
63
66
|
attribute? :delete_chat_photo, Types::True
|
|
@@ -75,6 +78,7 @@ module Telegram
|
|
|
75
78
|
attribute? :chat_shared, ChatShared
|
|
76
79
|
attribute? :gift, GiftInfo
|
|
77
80
|
attribute? :unique_gift, UniqueGiftInfo
|
|
81
|
+
attribute? :gift_upgrade_sent, GiftInfo
|
|
78
82
|
attribute? :connected_website, Types::String
|
|
79
83
|
attribute? :write_access_allowed, WriteAccessAllowed
|
|
80
84
|
attribute? :passport_data, PassportData
|
|
@@ -107,7 +111,9 @@ module Telegram
|
|
|
107
111
|
attribute? :web_app_data, WebAppData
|
|
108
112
|
attribute? :reply_markup, InlineKeyboardMarkup
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
def to_s
|
|
115
|
+
text.to_s
|
|
116
|
+
end
|
|
111
117
|
end
|
|
112
118
|
end
|
|
113
119
|
end
|
|
@@ -17,6 +17,8 @@ module Telegram
|
|
|
17
17
|
attribute? :was_refunded, Types::True
|
|
18
18
|
attribute? :convert_star_count, Types::Integer
|
|
19
19
|
attribute? :prepaid_upgrade_star_count, Types::Integer
|
|
20
|
+
attribute? :is_upgrade_separate, Types::True
|
|
21
|
+
attribute? :unique_gift_number, Types::Integer
|
|
20
22
|
end
|
|
21
23
|
end
|
|
22
24
|
end
|
|
@@ -4,12 +4,17 @@ module Telegram
|
|
|
4
4
|
module Bot
|
|
5
5
|
module Types
|
|
6
6
|
class UniqueGift < Base
|
|
7
|
+
attribute :gift_id, Types::String
|
|
7
8
|
attribute :base_name, Types::String
|
|
8
9
|
attribute :name, Types::String
|
|
9
10
|
attribute :number, Types::Integer
|
|
10
11
|
attribute :model, UniqueGiftModel
|
|
11
12
|
attribute :symbol, UniqueGiftSymbol
|
|
12
13
|
attribute :backdrop, UniqueGiftBackdrop
|
|
14
|
+
attribute? :is_premium, Types::True
|
|
15
|
+
attribute? :is_burned, Types::True
|
|
16
|
+
attribute? :is_from_blockchain, Types::True
|
|
17
|
+
attribute? :colors, UniqueGiftColors
|
|
13
18
|
attribute? :publisher_chat, Chat
|
|
14
19
|
end
|
|
15
20
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class UniqueGiftColors < Base
|
|
7
|
+
attribute :model_custom_emoji_id, Types::String
|
|
8
|
+
attribute :symbol_custom_emoji_id, Types::String
|
|
9
|
+
attribute :light_theme_main_color, Types::Integer
|
|
10
|
+
attribute :light_theme_other_colors, Types::Array.of(Types::Integer)
|
|
11
|
+
attribute :dark_theme_main_color, Types::Integer
|
|
12
|
+
attribute :dark_theme_other_colors, Types::Array.of(Types::Integer)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -6,7 +6,8 @@ module Telegram
|
|
|
6
6
|
class UniqueGiftInfo < Base
|
|
7
7
|
attribute :gift, UniqueGift
|
|
8
8
|
attribute :origin, Types::String
|
|
9
|
-
attribute? :
|
|
9
|
+
attribute? :last_resale_currency, Types::String
|
|
10
|
+
attribute? :last_resale_amount, Types::Integer
|
|
10
11
|
attribute? :owned_gift_id, Types::String
|
|
11
12
|
attribute? :transfer_star_count, Types::Integer
|
|
12
13
|
attribute? :next_transfer_date, Types::Integer
|
|
@@ -17,6 +17,8 @@ module Telegram
|
|
|
17
17
|
attribute? :supports_inline_queries, Types::Bool
|
|
18
18
|
attribute? :can_connect_to_business, Types::Bool
|
|
19
19
|
attribute? :has_main_web_app, Types::Bool
|
|
20
|
+
attribute? :has_topics_enabled, Types::Bool
|
|
21
|
+
attribute? :allows_users_to_create_topics, Types::Bool
|
|
20
22
|
end
|
|
21
23
|
end
|
|
22
24
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class UserRating < Base
|
|
7
|
+
attribute :level, Types::Integer
|
|
8
|
+
attribute :rating, Types::Integer
|
|
9
|
+
attribute :current_level_rating, Types::Integer
|
|
10
|
+
attribute? :next_level_rating, Types::Integer
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -12,6 +12,7 @@ module Telegram
|
|
|
12
12
|
attribute? :thumbnail, PhotoSize
|
|
13
13
|
attribute? :cover, Types::Array.of(PhotoSize)
|
|
14
14
|
attribute? :start_timestamp, Types::Integer
|
|
15
|
+
attribute? :qualities, Types::Array.of(VideoQuality)
|
|
15
16
|
attribute? :file_name, Types::String
|
|
16
17
|
attribute? :mime_type, Types::String
|
|
17
18
|
attribute? :file_size, Types::Integer
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telegram
|
|
4
|
+
module Bot
|
|
5
|
+
module Types
|
|
6
|
+
class VideoQuality < Base
|
|
7
|
+
attribute :file_id, Types::String
|
|
8
|
+
attribute :file_unique_id, Types::String
|
|
9
|
+
attribute :width, Types::Integer
|
|
10
|
+
attribute :height, Types::Integer
|
|
11
|
+
attribute :codec, Types::String
|
|
12
|
+
attribute? :file_size, Types::Integer
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
data/lib/telegram/bot/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: telegram-bot-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Tipugin
|
|
@@ -71,6 +71,7 @@ executables: []
|
|
|
71
71
|
extensions: []
|
|
72
72
|
extra_rdoc_files: []
|
|
73
73
|
files:
|
|
74
|
+
- ".claude/skills/update-api/SKILL.md"
|
|
74
75
|
- ".editorconfig"
|
|
75
76
|
- ".env.sample"
|
|
76
77
|
- ".github/workflows/ci.yml"
|
|
@@ -154,6 +155,8 @@ files:
|
|
|
154
155
|
- lib/telegram/bot/types/chat_member_owner.rb
|
|
155
156
|
- lib/telegram/bot/types/chat_member_restricted.rb
|
|
156
157
|
- lib/telegram/bot/types/chat_member_updated.rb
|
|
158
|
+
- lib/telegram/bot/types/chat_owner_changed.rb
|
|
159
|
+
- lib/telegram/bot/types/chat_owner_left.rb
|
|
157
160
|
- lib/telegram/bot/types/chat_permissions.rb
|
|
158
161
|
- lib/telegram/bot/types/chat_photo.rb
|
|
159
162
|
- lib/telegram/bot/types/chat_shared.rb
|
|
@@ -185,6 +188,7 @@ files:
|
|
|
185
188
|
- lib/telegram/bot/types/general_forum_topic_hidden.rb
|
|
186
189
|
- lib/telegram/bot/types/general_forum_topic_unhidden.rb
|
|
187
190
|
- lib/telegram/bot/types/gift.rb
|
|
191
|
+
- lib/telegram/bot/types/gift_background.rb
|
|
188
192
|
- lib/telegram/bot/types/gift_info.rb
|
|
189
193
|
- lib/telegram/bot/types/gifts.rb
|
|
190
194
|
- lib/telegram/bot/types/giveaway.rb
|
|
@@ -357,13 +361,16 @@ files:
|
|
|
357
361
|
- lib/telegram/bot/types/unique_gift.rb
|
|
358
362
|
- lib/telegram/bot/types/unique_gift_backdrop.rb
|
|
359
363
|
- lib/telegram/bot/types/unique_gift_backdrop_colors.rb
|
|
364
|
+
- lib/telegram/bot/types/unique_gift_colors.rb
|
|
360
365
|
- lib/telegram/bot/types/unique_gift_info.rb
|
|
361
366
|
- lib/telegram/bot/types/unique_gift_model.rb
|
|
362
367
|
- lib/telegram/bot/types/unique_gift_symbol.rb
|
|
363
368
|
- lib/telegram/bot/types/update.rb
|
|
364
369
|
- lib/telegram/bot/types/user.rb
|
|
365
370
|
- lib/telegram/bot/types/user_chat_boosts.rb
|
|
371
|
+
- lib/telegram/bot/types/user_profile_audios.rb
|
|
366
372
|
- lib/telegram/bot/types/user_profile_photos.rb
|
|
373
|
+
- lib/telegram/bot/types/user_rating.rb
|
|
367
374
|
- lib/telegram/bot/types/users_shared.rb
|
|
368
375
|
- lib/telegram/bot/types/venue.rb
|
|
369
376
|
- lib/telegram/bot/types/video.rb
|
|
@@ -372,6 +379,7 @@ files:
|
|
|
372
379
|
- lib/telegram/bot/types/video_chat_scheduled.rb
|
|
373
380
|
- lib/telegram/bot/types/video_chat_started.rb
|
|
374
381
|
- lib/telegram/bot/types/video_note.rb
|
|
382
|
+
- lib/telegram/bot/types/video_quality.rb
|
|
375
383
|
- lib/telegram/bot/types/voice.rb
|
|
376
384
|
- lib/telegram/bot/types/web_app_data.rb
|
|
377
385
|
- lib/telegram/bot/types/web_app_info.rb
|