telegram-bot-ruby 1.0.0.rc1 → 1.0.0

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: 2d6220dcbd9e12cc3ab22702dfbff66853f8cdc83fcf78ed59d63f2740051c29
4
- data.tar.gz: 1b50037b1b26470cdbbc7624d484ac38403f23eccfc7586788232a391ac0c6bf
3
+ metadata.gz: 849ef276ecc1cfd4531ccd49474ca72e21e6a737f4ee49af374fd0f2cb7a6368
4
+ data.tar.gz: 8d451387892328aff6a1205f0b31b9221a07319c0b8d927c655d40283d2efc09
5
5
  SHA512:
6
- metadata.gz: 8fc94125380ac64cd590da0ff841db37e7aaa4ee06d14bceb7a6a2d5a46e1747633479af81adeddfabd5a3006c79d5be331936417fda2aabb20a76de5d4fe211
7
- data.tar.gz: a4c09c3f00dae5d38f612f78fb70a24c6f2d6443be25da47b9fd45661dc3b9d2c5185e5f73c9aa5a7b71c6c74b57677ca53e9182d42b0396d372d4837a6af0f9
6
+ metadata.gz: ef343c2f15ee929777e6f03b5cc2e9af8f593e49a15bb751301476996bff8bcc3c79b99c962c5e865a379f23ddf8d505b0fabe22a3033a6e950a703ea54a9fa3
7
+ data.tar.gz: a9add629f338919e2584cccb8c7b206eaef726df39021ac0f9b42e26e7cf2c1cb65a28735e0010c3f390aee0f90f29fcb3a5d2c1981f0b8ba4829d55b14fd421
@@ -13,7 +13,7 @@ jobs:
13
13
  matrix:
14
14
  ruby:
15
15
  - 2.7
16
- - 3.1
16
+ - 3.2
17
17
  steps:
18
18
  - name: Checkout
19
19
  uses: actions/checkout@v3
@@ -31,7 +31,7 @@ jobs:
31
31
  matrix:
32
32
  ruby:
33
33
  - 2.7
34
- - 3.1
34
+ - 3.2
35
35
  env:
36
36
  BOT_API_ENV: test
37
37
  BOT_API_TOKEN: ${{ secrets.BOT_API_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0
4
+
5
+ - Replace [virtus](https://github.com/solnic/virtus) with [dry-struct](https://github.com/dry-rb/dry-struct)
6
+ - Use [zeitwerk](https://github.com/fxn/zeitwerk) for code loading
7
+ - Implement [Bot API 6.4](https://core.telegram.org/bots/api#december-30-2022)
8
+ - Implement [Bot API 6.5](https://core.telegram.org/bots/api#february-3-2023)
9
+
3
10
  ## 0.23.0
4
11
 
5
12
  - Rename `Telegram::Bot.configuration` options:
data/Gemfile CHANGED
@@ -3,3 +3,12 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
+
7
+ gem 'dotenv', '~> 2.8'
8
+ gem 'nokogiri', '~> 1.13'
9
+ gem 'pry'
10
+ gem 'rake', '~> 13.0'
11
+ gem 'rspec', '~> 3.4'
12
+ gem 'rubocop', '~> 1.27'
13
+ gem 'rubocop-rake'
14
+ gem 'rubocop-rspec', '~> 2.10'
data/README.md CHANGED
@@ -7,6 +7,21 @@ Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
7
7
  [![Maintainability](https://api.codeclimate.com/v1/badges/7e61fbf5bec86e118fb1/maintainability)](https://codeclimate.com/github/atipugin/telegram-bot-ruby/maintainability)
8
8
  [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks!-🦉-1EAEDB.svg)](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) instead of [virtus](https://github.com/solnic/virtus). This means that type objects are now immutable and you can't change them after initialization:
13
+
14
+ ```ruby
15
+ # This won't work
16
+ kb = Telegram::Bot::Types::ReplyKeyboardRemove.new
17
+ kb.remove_keyboard = true
18
+
19
+ # You have to set attributes in constructor instead
20
+ kb = Telegram::Bot::Types::ReplyKeyboardRemove.new(remove_keyboard: true)
21
+ ```
22
+
23
+ Please make sure it doesn't break your existing code before upgrading to 1.0.
24
+
10
25
  ## Installation
11
26
 
12
27
  Add following line to your Gemfile:
@@ -6,6 +6,7 @@ module Telegram
6
6
  class ChatJoinRequest < Base
7
7
  attribute :chat, Chat
8
8
  attribute :from, User
9
+ attribute :user_chat_id, Types::Integer
9
10
  attribute :date, Types::Integer
10
11
  attribute? :bio, Types::String
11
12
  attribute? :invite_link, ChatInviteLink
@@ -7,15 +7,20 @@ module Telegram
7
7
  attribute :status, Types::String
8
8
  attribute :user, User
9
9
  attribute :is_member, Types::Bool
10
- attribute :can_change_info, Types::Bool
11
- attribute :can_invite_users, Types::Bool
12
- attribute :can_pin_messages, Types::Bool
13
- attribute :can_manage_topics, Types::Bool
14
10
  attribute :can_send_messages, Types::Bool
15
- attribute :can_send_media_messages, Types::Bool
11
+ attribute :can_send_audios, Types::Bool
12
+ attribute :can_send_documents, Types::Bool
13
+ attribute :can_send_photos, Types::Bool
14
+ attribute :can_send_videos, Types::Bool
15
+ attribute :can_send_video_notes, Types::Bool
16
+ attribute :can_send_voice_notes, Types::Bool
16
17
  attribute :can_send_polls, Types::Bool
17
18
  attribute :can_send_other_messages, Types::Bool
18
19
  attribute :can_add_web_page_previews, Types::Bool
20
+ attribute :can_change_info, Types::Bool
21
+ attribute :can_invite_users, Types::Bool
22
+ attribute :can_pin_messages, Types::Bool
23
+ attribute :can_manage_topics, Types::Bool
19
24
  attribute :until_date, Types::Integer
20
25
  end
21
26
  end
@@ -5,7 +5,12 @@ module Telegram
5
5
  module Types
6
6
  class ChatPermissions < Base
7
7
  attribute? :can_send_messages, Types::Bool
8
- attribute? :can_send_media_messages, Types::Bool
8
+ attribute? :can_send_audios, Types::Bool
9
+ attribute? :can_send_documents, Types::Bool
10
+ attribute? :can_send_photos, Types::Bool
11
+ attribute? :can_send_videos, Types::Bool
12
+ attribute? :can_send_video_notes, Types::Bool
13
+ attribute? :can_send_voice_notes, Types::Bool
9
14
  attribute? :can_send_polls, Types::Bool
10
15
  attribute? :can_send_other_messages, Types::Bool
11
16
  attribute? :can_add_web_page_previews, Types::Bool
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChatShared < Base
7
+ attribute :request_id, Types::Integer
8
+ attribute :chat_id, Types::Integer
9
+ end
10
+ end
11
+ end
12
+ end
@@ -5,6 +5,8 @@ module Telegram
5
5
  module Types
6
6
  class KeyboardButton < Base
7
7
  attribute :text, Types::String
8
+ attribute? :request_user, KeyboardButtonRequestUser
9
+ attribute? :request_chat, KeyboardButtonRequestChat
8
10
  attribute? :request_contact, Types::Bool
9
11
  attribute? :request_location, Types::Bool
10
12
  attribute? :request_poll, KeyboardButtonPollType
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class KeyboardButtonRequestChat < Base
7
+ attribute :request_id, Types::Integer
8
+ attribute :chat_is_channel, Types::Bool
9
+ attribute? :chat_is_forum, Types::Bool
10
+ attribute? :chat_has_username, Types::Bool
11
+ attribute? :chat_is_created, Types::Bool
12
+ attribute? :user_administrator_rights, ChatAdministratorRights
13
+ attribute? :bot_administrator_rights, ChatAdministratorRights
14
+ attribute? :bot_is_member, Types::Bool
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class KeyboardButtonRequestUser < Base
7
+ attribute :request_id, Types::Integer
8
+ attribute? :user_is_bot, Types::Bool
9
+ attribute? :user_is_premium, Types::Bool
10
+ end
11
+ end
12
+ end
13
+ end
@@ -57,6 +57,8 @@ module Telegram
57
57
  attribute? :pinned_message, Message
58
58
  attribute? :invoice, Invoice
59
59
  attribute? :successful_payment, SuccessfulPayment
60
+ attribute? :user_shared, UserShared
61
+ attribute? :chat_shared, ChatShared
60
62
  attribute? :connected_website, Types::String
61
63
  attribute? :write_access_allowed, WriteAccessAllowed
62
64
  attribute? :passport_data, PassportData
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class UserShared < Base
7
+ attribute :request_id, Types::Integer
8
+ attribute :user_id, Types::Integer
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Telegram
4
4
  module Bot
5
- VERSION = '1.0.0.rc1'
5
+ VERSION = '1.0.0'
6
6
  end
7
7
  end
@@ -26,13 +26,4 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'faraday', '~> 2.0'
27
27
  spec.add_dependency 'faraday-multipart', '~> 1.0'
28
28
  spec.add_dependency 'zeitwerk', '~> 2.6'
29
-
30
- spec.add_development_dependency 'dotenv', '~> 2.8'
31
- spec.add_development_dependency 'nokogiri', '~> 1.13'
32
- spec.add_development_dependency 'pry'
33
- spec.add_development_dependency 'rake', '~> 13.0'
34
- spec.add_development_dependency 'rspec', '~> 3.4'
35
- spec.add_development_dependency 'rubocop', '~> 1.27'
36
- spec.add_development_dependency 'rubocop-rake'
37
- spec.add_development_dependency 'rubocop-rspec', '~> 2.10'
38
29
  end
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: 1.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: 2023-02-13 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
@@ -234,6 +122,7 @@ files:
234
122
  - lib/telegram/bot/types/chat_member_updated.rb
235
123
  - lib/telegram/bot/types/chat_permissions.rb
236
124
  - lib/telegram/bot/types/chat_photo.rb
125
+ - lib/telegram/bot/types/chat_shared.rb
237
126
  - lib/telegram/bot/types/chosen_inline_result.rb
238
127
  - lib/telegram/bot/types/compactable.rb
239
128
  - lib/telegram/bot/types/contact.rb
@@ -289,6 +178,8 @@ files:
289
178
  - lib/telegram/bot/types/invoice.rb
290
179
  - lib/telegram/bot/types/keyboard_button.rb
291
180
  - lib/telegram/bot/types/keyboard_button_poll_type.rb
181
+ - lib/telegram/bot/types/keyboard_button_request_chat.rb
182
+ - lib/telegram/bot/types/keyboard_button_request_user.rb
292
183
  - lib/telegram/bot/types/labeled_price.rb
293
184
  - lib/telegram/bot/types/location.rb
294
185
  - lib/telegram/bot/types/login_url.rb
@@ -330,6 +221,7 @@ files:
330
221
  - lib/telegram/bot/types/update.rb
331
222
  - lib/telegram/bot/types/user.rb
332
223
  - lib/telegram/bot/types/user_profile_photos.rb
224
+ - lib/telegram/bot/types/user_shared.rb
333
225
  - lib/telegram/bot/types/venue.rb
334
226
  - lib/telegram/bot/types/video.rb
335
227
  - lib/telegram/bot/types/video_chat_ended.rb
@@ -359,11 +251,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
359
251
  version: '2.7'
360
252
  required_rubygems_version: !ruby/object:Gem::Requirement
361
253
  requirements:
362
- - - ">"
254
+ - - ">="
363
255
  - !ruby/object:Gem::Version
364
- version: 1.3.1
256
+ version: '0'
365
257
  requirements: []
366
- rubygems_version: 3.4.1
258
+ rubygems_version: 3.4.2
367
259
  signing_key:
368
260
  specification_version: 4
369
261
  summary: Ruby wrapper for Telegram's Bot API