telegram-bot-ruby 2.1.0 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce32f0e31b213f3dd24a30acb1e060fa270f490e5bd58f67bf2f6ffed48367da
4
- data.tar.gz: eb85be8ba100f9aa6a9cac12e77747f6acd0922bfd86c6a69b5cc183046d80d8
3
+ metadata.gz: 751792d39688d9d392978b98478b1b5c765bc67ec8bad10d7e94102abf3c1c4b
4
+ data.tar.gz: 5047aa5738592ae076c73916d2292fc0ddaa76f01d4f2a00d9a0c98ba1bff543
5
5
  SHA512:
6
- metadata.gz: 8e37d51c14c8cadcb88278491aeddeb677b6d1e21c64e757226b32c1d76a7243d4080beb90d72ee35e1ada0b3583bf1e24b09c0c0f411ece3a2dc0f5955339ab
7
- data.tar.gz: 2e7917652117aef22497d752efc92b378c89cdd8d65380670e904357a4b7514778cdccaa4c3ea2998f49770e16d362d314bb6c98d15ccfd2e75d78d0349be1a6
6
+ metadata.gz: 39f033c125684f68e6ddbfc00fc055ccc38c5bc776f280c0fb98e286cb7b067bfa69386984e388600345dd1c6e8a4470d890eb6a00444d963c8f724b67ed69de
7
+ data.tar.gz: e729edac77f62854622ea4eff1c6ceeb244ee95afcce3ede8d440a94d864e77cbad4b59fff2cb202b4fd83692939a3535b53aa7f07ae9892f2a920b623168dc0
data/CHANGELOG.md CHANGED
@@ -1,16 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Added
6
+
7
+ - [Bot API 8.2](https://core.telegram.org/bots/api#january-1-2025) [#322](https://github.com/atipugin/telegram-bot-ruby/pull/322)
8
+
9
+ ## 2.2.0
10
+
11
+ ### Added
12
+
13
+ - [Bot API 8.1](https://core.telegram.org/bots/api-changelog#december-4-2024) [#319](https://github.com/atipugin/telegram-bot-ruby/pull/319)
14
+
3
15
  ## 2.1.0
4
16
 
5
17
  ### Added
6
18
 
7
- - [Bot API 8.0](https://core.telegram.org/bots/api#november-17-2024)
19
+ - [Bot API 8.0](https://core.telegram.org/bots/api-changelog#november-17-2024) (thx [@seorgiy](https://github.com/seorgiy))
8
20
 
9
21
  ## 2.0.0
10
22
 
11
23
  ### Added
12
24
 
13
- - [Bot API 7.0](https://core.telegram.org/bots/api#december-29-2023)
25
+ - [Bot API 7.0](https://core.telegram.org/bots/api-changelog#december-29-2023)
14
26
 
15
27
  ### Changed
16
28
 
@@ -20,8 +32,8 @@
20
32
 
21
33
  - Replace [virtus](https://github.com/solnic/virtus) with [dry-struct](https://github.com/dry-rb/dry-struct)
22
34
  - Use [zeitwerk](https://github.com/fxn/zeitwerk) for code loading
23
- - Implement [Bot API 6.4](https://core.telegram.org/bots/api#december-30-2022)
24
- - Implement [Bot API 6.5](https://core.telegram.org/bots/api#february-3-2023)
35
+ - Implement [Bot API 6.4](https://core.telegram.org/bots/api-changelog#december-30-2022)
36
+ - Implement [Bot API 6.5](https://core.telegram.org/bots/api-changelog#february-3-2023)
25
37
 
26
38
  ## 0.23.0
27
39
 
@@ -32,8 +44,8 @@
32
44
 
33
45
  ## 0.21.0
34
46
 
35
- - Implement [Bot API 6.1](https://core.telegram.org/bots/api#june-20-2022)
36
- - Implement [Bot API 6.2](https://core.telegram.org/bots/api#august-12-2022)
47
+ - Implement [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
48
+ - Implement [Bot API 6.2](https://core.telegram.org/bots/api-changelog#august-12-2022)
37
49
 
38
50
  ## 0.20.0
39
51
 
@@ -64,11 +76,11 @@
64
76
 
65
77
  ## 0.15.0
66
78
 
67
- - Implement [Bot API 5.1](https://core.telegram.org/bots/api#march-9-2021)
79
+ - Implement [Bot API 5.1](https://core.telegram.org/bots/api-changelog#march-9-2021)
68
80
 
69
81
  ## 0.14.0
70
82
 
71
- - Implement [Bot API 5.0](https://core.telegram.org/bots/api#november-4-2020)
83
+ - Implement [Bot API 5.0](https://core.telegram.org/bots/api-changelog#november-4-2020)
72
84
 
73
85
  ## 0.13.0
74
86
 
@@ -82,7 +94,7 @@
82
94
 
83
95
  ## 0.11.0
84
96
 
85
- - Implement [Bot API 4.4](https://core.telegram.org/bots/api#july-29-2019)
97
+ - Implement [Bot API 4.4](https://core.telegram.org/bots/api-changelog#july-29-2019)
86
98
 
87
99
  ## 0.10.1
88
100
 
@@ -90,7 +102,7 @@
90
102
 
91
103
  ## 0.10.0
92
104
 
93
- - Implement [Bot API 4.3](https://core.telegram.org/bots/api#may-31-2019)
105
+ - Implement [Bot API 4.3](https://core.telegram.org/bots/api-changelog#may-31-2019)
94
106
 
95
107
  ## 0.9.1
96
108
 
@@ -109,23 +121,23 @@
109
121
 
110
122
  ## 0.8.6
111
123
 
112
- - Implement [Bot API 3.5](https://core.telegram.org/bots/api#november-17-2017)
124
+ - Implement [Bot API 3.5](https://core.telegram.org/bots/api-changelog#november-17-2017)
113
125
 
114
126
  ## 0.8.5
115
127
 
116
- - Implement [Bot API 3.4](https://core.telegram.org/bots/api#october-11-2017) (thx [@ivanovaleksey][])
128
+ - Implement [Bot API 3.4](https://core.telegram.org/bots/api-changelog#october-11-2017) (thx [@ivanovaleksey][])
117
129
 
118
130
  ## 0.8.4
119
131
 
120
- - Implement [Bot API 3.3](https://core.telegram.org/bots/api#august-23-2017) (thx [@ivanovaleksey][])
132
+ - Implement [Bot API 3.3](https://core.telegram.org/bots/api-changelog#august-23-2017) (thx [@ivanovaleksey][])
121
133
 
122
134
  ## 0.8.3
123
135
 
124
- - Implement [Bot API 3.2](https://core.telegram.org/bots/api#july-21-2017) (thx [@ivanovaleksey][])
136
+ - Implement [Bot API 3.2](https://core.telegram.org/bots/api-changelog#july-21-2017) (thx [@ivanovaleksey][])
125
137
 
126
138
  ## 0.8.2
127
139
 
128
- - Implement [Bot API 3.1](https://core.telegram.org/bots/api#june-30-2017) (thx [@ivanovaleksey][])
140
+ - Implement [Bot API 3.1](https://core.telegram.org/bots/api-changelog#june-30-2017) (thx [@ivanovaleksey][])
129
141
 
130
142
  ## 0.8.1
131
143
 
@@ -133,7 +145,7 @@
133
145
 
134
146
  ## 0.8.0
135
147
 
136
- - Implement [Bot API 3.0](https://core.telegram.org/bots/api#may-18-2017) (thx [@ivanovaleksey][])
148
+ - Implement [Bot API 3.0](https://core.telegram.org/bots/api-changelog#may-18-2017) (thx [@ivanovaleksey][])
137
149
 
138
150
  ## 0.7.2
139
151
 
data/README.md CHANGED
@@ -29,7 +29,7 @@ Please make sure it doesn't break your existing code before upgrading to 1.0.
29
29
  Add following line to your Gemfile:
30
30
 
31
31
  ```ruby
32
- gem 'telegram-bot-ruby', '~> 1.0'
32
+ gem 'telegram-bot-ruby', '~> 2.1'
33
33
  ```
34
34
 
35
35
  And then execute:
@@ -117,7 +117,11 @@ module Telegram
117
117
  'sendGift' => Types::Bool,
118
118
  'savePreparedInlineMessage' => Types::PreparedInlineMessage,
119
119
  'editUserStarSubscription' => Types::Bool,
120
- 'setUserEmojiStatus' => Types::Bool
120
+ 'setUserEmojiStatus' => Types::Bool,
121
+ 'verifyUser' => Types::Bool,
122
+ 'verifyChat' => Types::Bool,
123
+ 'removeUserVerification' => Types::Bool,
124
+ 'removeChatVerification' => Types::Bool
121
125
  }.freeze
122
126
  end
123
127
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class AffiliateInfo < Base
7
+ attribute? :affiliate_user, User
8
+ attribute? :affiliate_chat, Chat
9
+ attribute :commission_per_mille, Types::Integer
10
+ attribute :amount, Types::Integer
11
+ attribute? :nanostar_amount, Types::Integer
12
+ end
13
+ end
14
+ end
15
+ end
@@ -7,6 +7,7 @@ module Telegram
7
7
  attribute :id, Types::String
8
8
  attribute :sticker, Sticker
9
9
  attribute :star_count, Types::Integer
10
+ attribute? :upgrade_star_count, Types::Integer
10
11
  attribute? :total_count, Types::Integer
11
12
  attribute? :remaining_count, Types::Integer
12
13
  end
@@ -10,7 +10,6 @@ module Telegram
10
10
  attribute :input_message_content, InputMessageContent
11
11
  attribute? :reply_markup, InlineKeyboardMarkup
12
12
  attribute? :url, Types::String
13
- attribute? :hide_url, Types::Bool
14
13
  attribute? :description, Types::String
15
14
  attribute? :thumbnail_url, Types::String
16
15
  attribute? :thumbnail_width, Types::Integer
@@ -6,6 +6,7 @@ module Telegram
6
6
  class StarTransaction < Base
7
7
  attribute :id, Types::String
8
8
  attribute :amount, Types::Integer
9
+ attribute? :nanostar_amount, Types::Integer
9
10
  attribute :date, Types::Integer
10
11
  attribute? :source, TransactionPartner
11
12
  attribute? :receiver, TransactionPartner
@@ -7,6 +7,7 @@ module Telegram
7
7
  # rubocop:disable Naming/ConstantName
8
8
  TransactionPartner = (
9
9
  TransactionPartnerUser |
10
+ TransactionPartnerAffiliateProgram |
10
11
  TransactionPartnerFragment |
11
12
  TransactionPartnerTelegramAds |
12
13
  TransactionPartnerTelegramApi |
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class TransactionPartnerAffiliateProgram < Base
7
+ attribute :type, Types::String.constrained(eql: 'affiliate_program').default('affiliate_program')
8
+ attribute? :sponsor_user, User
9
+ attribute :commission_per_mille, Types::Integer
10
+ end
11
+ end
12
+ end
13
+ end
@@ -6,6 +6,7 @@ module Telegram
6
6
  class TransactionPartnerUser < Base
7
7
  attribute :type, Types::String.constrained(eql: 'user').default('user')
8
8
  attribute :user, User
9
+ attribute? :affiliate, AffiliateInfo
9
10
  attribute? :invoice_payload, Types::String
10
11
  attribute? :subscription_period, Types::Integer
11
12
  attribute? :paid_media, Types::Array.of(PaidMedia)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Telegram
4
4
  module Bot
5
- VERSION = '2.1.0'
5
+ VERSION = '2.3.0'
6
6
  end
7
7
  end
@@ -50,7 +50,7 @@ task :parse_schema do
50
50
  end
51
51
 
52
52
  # Input File is literally just a string for our purpose
53
- File.write "#{__dir__}/../utility/type_attributes.json", JSON.pretty_generate(result.except('InputFile'))
53
+ File.write "#{__dir__}/../data/type_attributes.json", JSON.pretty_generate(result.except('InputFile'))
54
54
  end
55
55
 
56
56
  def required_keys(schema)
@@ -6,7 +6,7 @@ DRY_TYPES = %w[string integer float decimal array hash symbol boolean date date_
6
6
 
7
7
  desc 'Rebuild types'
8
8
  task :rebuild_types do
9
- types = JSON.parse(File.read("#{__dir__}/../utility/type_attributes.json"), symbolize_names: true)
9
+ types = JSON.parse(File.read("#{__dir__}/../data/type_attributes.json"), symbolize_names: true)
10
10
 
11
11
  types.each_pair do |name, attributes|
12
12
  next build_empty_type(name, attributes) if attributes[:type].instance_of?(Array)
@@ -35,14 +35,14 @@ task :rebuild_types do
35
35
  end
36
36
 
37
37
  File.write "#{__dir__}/../lib/telegram/bot/types/#{underscore(name)}.rb",
38
- ERB.new(File.read("#{__dir__}/../utility/type.erb")).result(binding).gsub(" \n", '')
38
+ ERB.new(File.read("#{__dir__}/templates/type.erb")).result(binding).gsub(" \n", '')
39
39
  end
40
40
  end
41
41
 
42
42
  def build_empty_type(name, attributes)
43
43
  attributes = attributes[:type].join(" |\n ")
44
44
  File.write "#{__dir__}/../lib/telegram/bot/types/#{underscore(name)}.rb",
45
- ERB.new(File.read("#{__dir__}/../utility/empty_type.erb")).result(binding).gsub(" \n", '')
45
+ ERB.new(File.read("#{__dir__}/templates/empty_type.erb")).result(binding).gsub(" \n", '')
46
46
  end
47
47
 
48
48
  def apply_default(attributes, attr_name, properties, original_type)
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "Ruby wrapper for Telegram's Bot API"
12
12
  spec.homepage = 'https://github.com/atipugin/telegram-bot'
13
13
 
14
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
14
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|data)/}) }
15
15
  spec.bindir = 'exe'
16
16
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
17
  spec.require_paths = ['lib']
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: 2.1.0
4
+ version: 2.3.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: 2024-11-24 00:00:00.000000000 Z
11
+ date: 2025-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -97,6 +97,7 @@ files:
97
97
  - lib/telegram/bot/exceptions/response_error.rb
98
98
  - lib/telegram/bot/null_logger.rb
99
99
  - lib/telegram/bot/types.rb
100
+ - lib/telegram/bot/types/affiliate_info.rb
100
101
  - lib/telegram/bot/types/animation.rb
101
102
  - lib/telegram/bot/types/audio.rb
102
103
  - lib/telegram/bot/types/background_fill.rb
@@ -307,6 +308,7 @@ files:
307
308
  - lib/telegram/bot/types/switch_inline_query_chosen_chat.rb
308
309
  - lib/telegram/bot/types/text_quote.rb
309
310
  - lib/telegram/bot/types/transaction_partner.rb
311
+ - lib/telegram/bot/types/transaction_partner_affiliate_program.rb
310
312
  - lib/telegram/bot/types/transaction_partner_fragment.rb
311
313
  - lib/telegram/bot/types/transaction_partner_other.rb
312
314
  - lib/telegram/bot/types/transaction_partner_telegram_ads.rb
@@ -332,10 +334,9 @@ files:
332
334
  - lib/telegram/bot/version.rb
333
335
  - rakelib/parse_schema.rake
334
336
  - rakelib/rebuild_types.rake
337
+ - rakelib/templates/empty_type.erb
338
+ - rakelib/templates/type.erb
335
339
  - telegram-bot-ruby.gemspec
336
- - utility/empty_type.erb
337
- - utility/type.erb
338
- - utility/type_attributes.json
339
340
  homepage: https://github.com/atipugin/telegram-bot
340
341
  licenses: []
341
342
  metadata: