telegram-bot-types 0.3.0 → 0.4.1

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/telegram/bot/types.rb +16 -1
  3. data/lib/telegram/bot/types/animation.rb +13 -0
  4. data/lib/telegram/bot/types/callback_game.rb +8 -0
  5. data/lib/telegram/bot/types/callback_query.rb +2 -0
  6. data/lib/telegram/bot/types/chat.rb +1 -0
  7. data/lib/telegram/bot/types/chat_member.rb +10 -0
  8. data/lib/telegram/bot/types/game.rb +14 -0
  9. data/lib/telegram/bot/types/game_high_score.rb +11 -0
  10. data/lib/telegram/bot/types/inline_keyboard_button.rb +3 -0
  11. data/lib/telegram/bot/types/inline_query_result_audio.rb +1 -0
  12. data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +1 -0
  13. data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +1 -0
  14. data/lib/telegram/bot/types/inline_query_result_game.rb +12 -0
  15. data/lib/telegram/bot/types/inline_query_result_gif.rb +1 -0
  16. data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +1 -0
  17. data/lib/telegram/bot/types/inline_query_result_voice.rb +1 -0
  18. data/lib/telegram/bot/types/invoice.rb +13 -0
  19. data/lib/telegram/bot/types/labeled_price.rb +10 -0
  20. data/lib/telegram/bot/types/message.rb +6 -1
  21. data/lib/telegram/bot/types/order_info.rb +12 -0
  22. data/lib/telegram/bot/types/pre_checkout_query.rb +15 -0
  23. data/lib/telegram/bot/types/{reply_keyboard_hide.rb → reply_keyboard_remove.rb} +2 -2
  24. data/lib/telegram/bot/types/shipping_address.rb +14 -0
  25. data/lib/telegram/bot/types/shipping_option.rb +11 -0
  26. data/lib/telegram/bot/types/shipping_query.rb +12 -0
  27. data/lib/telegram/bot/types/successful_payment.rb +15 -0
  28. data/lib/telegram/bot/types/update.rb +2 -0
  29. data/lib/telegram/bot/types/user.rb +1 -0
  30. data/lib/telegram/bot/types/user_profile_photos.rb +1 -1
  31. data/lib/telegram/bot/types/version.rb +1 -1
  32. data/lib/telegram/bot/types/video_note.rb +13 -0
  33. data/telegram-bot-types.gemspec +0 -1
  34. metadata +19 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ff08b336315c35d2fab807ae700f6699c1def62
4
- data.tar.gz: f27f97750ab48c11c8c57c98abca5b2845c97552
3
+ metadata.gz: 85255981f3fa947c7001592ffa42a38cd96e9916
4
+ data.tar.gz: bd72458c724896c5ea7a58c0b3d22b552861cc27
5
5
  SHA512:
6
- metadata.gz: 743b147a9662f57c95ed200bb568e53bb38bf9cd1fb95a15d76695c0fa59f766fe8633cb3973a3e0e730e540c1bdaf87065f0fcd1d843905137daea77c917610
7
- data.tar.gz: 4c0a2ee263e74675b47b27430e677454555c0954fe7aabb349aba94151aa7318a5839899120a107ea1946ad7f8cb23199600cfabeed443f3610ac0bee3ff1da4
6
+ metadata.gz: 4c49b3b44ab2731764e7d7b4d5f6ad3a9f261d512a87089e5a2822bb7721308398295617fcf458fa35bbb5eaa9e0d08c011074771ddf084da633e9e7728248d9
7
+ data.tar.gz: 79e3ef124f2e3ab0fe3cfe8e5aee74a2f4d94597f3f60a1bb5f4a5d409a988bc8ae7dca28d03415155ce6e508984c0bfb8695a5c6e004bc45ffb66e968788ced
@@ -4,15 +4,20 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  %w(
7
+ animation
7
8
  audio
8
9
  base
10
+ callback_game
9
11
  callback_query
10
12
  chat
13
+ chat_member
11
14
  chosen_inline_result
12
15
  contact
13
16
  document
14
17
  file
15
18
  force_reply
19
+ game
20
+ game_high_score
16
21
  inline_keyboard_button
17
22
  inline_keyboard_markup
18
23
  inline_query
@@ -28,6 +33,7 @@ module Telegram
28
33
  inline_query_result_cached_voice
29
34
  inline_query_result_contact
30
35
  inline_query_result_document
36
+ inline_query_result_game
31
37
  inline_query_result_gif
32
38
  inline_query_result_location
33
39
  inline_query_result_mpeg4_gif
@@ -40,20 +46,29 @@ module Telegram
40
46
  input_message_content
41
47
  input_text_message_content
42
48
  input_venue_message_content
49
+ invoice
43
50
  keyboard_button
51
+ labeled_price
44
52
  location
45
53
  message
46
54
  message_entity
55
+ order_info
47
56
  photo_size
48
- reply_keyboard_hide
57
+ pre_checkout_query
49
58
  reply_keyboard_markup
59
+ reply_keyboard_remove
60
+ shipping_address
61
+ shipping_option
62
+ shipping_query
50
63
  sticker
64
+ successful_payment
51
65
  update
52
66
  user
53
67
  user_profile_photos
54
68
  venue
55
69
  version
56
70
  video
71
+ video_note
57
72
  voice
58
73
  ).each do |type|
59
74
  autoload type.camelize, "telegram/bot/types/#{type}"
@@ -0,0 +1,13 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class Animation < Base
5
+ attribute :file_id, String
6
+ attribute :thumb, PhotoSize
7
+ attribute :file_name, String
8
+ attribute :mime_type, String
9
+ attribute :file_size, Integer
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class CallbackGame < Base
5
+ end
6
+ end
7
+ end
8
+ end
@@ -6,7 +6,9 @@ module Telegram
6
6
  attribute :from, User
7
7
  attribute :message, Message
8
8
  attribute :inline_message_id, String
9
+ attribute :chat_instance, String
9
10
  attribute :data, String
11
+ attribute :game_short_name, String
10
12
  end
11
13
  end
12
14
  end
@@ -8,6 +8,7 @@ module Telegram
8
8
  attribute :username, String
9
9
  attribute :first_name, String
10
10
  attribute :last_name, String
11
+ attribute :all_members_are_administrators, Boolean
11
12
  end
12
13
  end
13
14
  end
@@ -0,0 +1,10 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class ChatMember < Base
5
+ attribute :user, User
6
+ attribute :status, String
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class Game < Base
5
+ attribute :title, String
6
+ attribute :description, String
7
+ attribute :photo, [PhotoSize]
8
+ attribute :text, String
9
+ attribute :text_entities, [MessageEntity]
10
+ attribute :animation, Animation
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class GameHighScore < Base
5
+ attribute :position, Integer
6
+ attribute :user, User
7
+ attribute :score, Integer
8
+ end
9
+ end
10
+ end
11
+ end
@@ -6,6 +6,9 @@ module Telegram
6
6
  attribute :url, String
7
7
  attribute :callback_data, String
8
8
  attribute :switch_inline_query, String
9
+ attribute :switch_inline_query_current_chat, String
10
+ attribute :callback_game, CallbackGame
11
+ attribute :pay, Boolean
9
12
  end
10
13
  end
11
14
  end
@@ -6,6 +6,7 @@ module Telegram
6
6
  attribute :id, String
7
7
  attribute :audio_url, String
8
8
  attribute :title, String
9
+ attribute :caption, String
9
10
  attribute :performer, String
10
11
  attribute :audio_duration, Integer
11
12
  attribute :reply_markup, InlineKeyboardMarkup
@@ -5,6 +5,7 @@ module Telegram
5
5
  attribute :type, String, default: 'audio'
6
6
  attribute :id, String
7
7
  attribute :audio_file_id, String
8
+ attribute :caption, String
8
9
  attribute :reply_markup, InlineKeyboardMarkup
9
10
  attribute :input_message_content, InputMessageContent
10
11
  end
@@ -6,6 +6,7 @@ module Telegram
6
6
  attribute :id, String
7
7
  attribute :voice_file_id, String
8
8
  attribute :title, String
9
+ attribute :caption, String
9
10
  attribute :reply_markup, InlineKeyboardMarkup
10
11
  attribute :input_message_content, InputMessageContent
11
12
  end
@@ -0,0 +1,12 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class InlineQueryResultGame < Base
5
+ attribute :type, String, default: 'game'
6
+ attribute :id, String
7
+ attribute :game_short_name, String
8
+ attribute :reply_markup, InlineKeyboardMarkup
9
+ end
10
+ end
11
+ end
12
+ end
@@ -7,6 +7,7 @@ module Telegram
7
7
  attribute :gif_url, String
8
8
  attribute :gif_width, Integer
9
9
  attribute :gif_height, Integer
10
+ attribute :gif_duration, Integer
10
11
  attribute :thumb_url, String
11
12
  attribute :title, String
12
13
  attribute :caption, String
@@ -7,6 +7,7 @@ module Telegram
7
7
  attribute :mpeg4_url, String
8
8
  attribute :mpeg4_width, Integer
9
9
  attribute :mpeg4_height, Integer
10
+ attribute :mpeg4_duration, Integer
10
11
  attribute :thumb_url, String
11
12
  attribute :title, String
12
13
  attribute :caption, String
@@ -6,6 +6,7 @@ module Telegram
6
6
  attribute :id, String
7
7
  attribute :voice_url, String
8
8
  attribute :title, String
9
+ attribute :caption, String
9
10
  attribute :voice_duration, Integer
10
11
  attribute :reply_markup, InlineKeyboardMarkup
11
12
  attribute :input_message_content, InputMessageContent
@@ -0,0 +1,13 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class Invoice < Base
5
+ attribute :title, String
6
+ attribute :description, String
7
+ attribute :start_parameter, String
8
+ attribute :currency, String
9
+ attribute :total_amount, Integer
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class LabeledPrice < Base
5
+ attribute :label, String
6
+ attribute :amount, Integer
7
+ end
8
+ end
9
+ end
10
+ end
@@ -8,6 +8,7 @@ module Telegram
8
8
  attribute :chat, Chat
9
9
  attribute :forward_from, User
10
10
  attribute :forward_from_chat, Chat
11
+ attribute :forward_from_message_id, Integer
11
12
  attribute :forward_date, Integer
12
13
  attribute :reply_to_message, Message
13
14
  attribute :edit_date, Integer
@@ -15,15 +16,17 @@ module Telegram
15
16
  attribute :entities, [MessageEntity]
16
17
  attribute :audio, Audio
17
18
  attribute :document, Document
19
+ attribute :game, Game
18
20
  attribute :photo, [PhotoSize]
19
21
  attribute :sticker, Sticker
20
22
  attribute :video, Video
21
23
  attribute :voice, Voice
24
+ attribute :video_note, VideoNote
22
25
  attribute :caption, String
23
26
  attribute :contact, Contact
24
27
  attribute :location, Location
25
28
  attribute :venue, Venue
26
- attribute :new_chat_member, User
29
+ attribute :new_chat_members, [User]
27
30
  attribute :left_chat_member, User
28
31
  attribute :new_chat_title, String
29
32
  attribute :new_chat_photo, [PhotoSize]
@@ -34,6 +37,8 @@ module Telegram
34
37
  attribute :migrate_to_chat_id, Integer
35
38
  attribute :migrate_from_chat_id, Integer
36
39
  attribute :pinned_message, Message
40
+ attribute :invoice, Invoice
41
+ attribute :successful_payment, SuccessfulPayment
37
42
 
38
43
  alias_method :to_s, :text
39
44
  end
@@ -0,0 +1,12 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class OrderInfo < Base
5
+ attribute :name, String
6
+ attribute :phone_number, String
7
+ attribute :email, String
8
+ attribute :shipping_address, ShippingAddress
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class PreCheckoutQuery < Base
5
+ attribute :id, String
6
+ attribute :from, User
7
+ attribute :currency, String
8
+ attribute :total_amount, Integer
9
+ attribute :invoice_payload, String
10
+ attribute :shipping_option_id, String
11
+ attribute :order_info, OrderInfo
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,8 +1,8 @@
1
1
  module Telegram
2
2
  module Bot
3
3
  module Types
4
- class ReplyKeyboardHide < Base
5
- attribute :hide_keyboard, Boolean
4
+ class ReplyKeyboardRemove < Base
5
+ attribute :remove_keyboard, Boolean
6
6
  attribute :selective, Boolean, default: false
7
7
  end
8
8
  end
@@ -0,0 +1,14 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class ShippingAddress < Base
5
+ attribute :country_code, String
6
+ attribute :state, String
7
+ attribute :city, String
8
+ attribute :street_line1, String
9
+ attribute :street_line2, String
10
+ attribute :post_code, String
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class ShippingOption < Base
5
+ attribute :id, String
6
+ attribute :title, String
7
+ attribute :prices, [LabeledPrice]
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class ShippingQuery < Base
5
+ attribute :id, String
6
+ attribute :from, User
7
+ attribute :invoice_payload, String
8
+ attribute :shipping_address, ShippingAddress
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class SuccessfulPayment < Base
5
+ attribute :currency, String
6
+ attribute :total_amount, Integer
7
+ attribute :invoice_payload, String
8
+ attribute :shipping_option_id, String
9
+ attribute :order_info, OrderInfo
10
+ attribute :telegram_payment_charge_id, String
11
+ attribute :provider_payment_charge_id, String
12
+ end
13
+ end
14
+ end
15
+ end
@@ -10,6 +10,8 @@ module Telegram
10
10
  attribute :inline_query, InlineQuery
11
11
  attribute :chosen_inline_result, ChosenInlineResult
12
12
  attribute :callback_query, CallbackQuery
13
+ attribute :shipping_query, ShippingQuery
14
+ attribute :pre_checkout_query, PreCheckoutQuery
13
15
  end
14
16
  end
15
17
  end
@@ -6,6 +6,7 @@ module Telegram
6
6
  attribute :first_name, String
7
7
  attribute :last_name, String
8
8
  attribute :username, String
9
+ attribute :language_code, String
9
10
  end
10
11
  end
11
12
  end
@@ -3,7 +3,7 @@ module Telegram
3
3
  module Types
4
4
  class UserProfilePhotos < Base
5
5
  attribute :total_count, Integer
6
- attribute :first_name, [[PhotoSize]]
6
+ attribute :photos, [[PhotoSize]]
7
7
  end
8
8
  end
9
9
  end
@@ -1,7 +1,7 @@
1
1
  module Telegram
2
2
  module Bot
3
3
  module Types
4
- VERSION = '0.3.0'.freeze
4
+ VERSION = '0.4.1'.freeze
5
5
 
6
6
  def self.gem_version
7
7
  Gem::Version.new VERSION
@@ -0,0 +1,13 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class VideoNote < Base
5
+ attribute :file_id, String
6
+ attribute :length, Integer
7
+ attribute :duration, Integer
8
+ attribute :thumb, PhotoSize
9
+ attribute :file_size, Integer
10
+ end
11
+ end
12
+ end
13
+ end
@@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
26
  spec.add_development_dependency 'rspec', '~> 3.3'
27
27
  spec.add_development_dependency 'rspec-its', '~> 1.1'
28
- spec.add_development_dependency 'activesupport', '~> 4.0'
29
28
 
30
29
  spec.add_development_dependency 'pry', '~> 0.10'
31
30
  spec.add_development_dependency 'rubocop', '~> 0.37.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot-types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tipugin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-12-09 00:00:00.000000000 Z
12
+ date: 2017-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: virtus
@@ -95,20 +95,6 @@ dependencies:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: '1.1'
98
- - !ruby/object:Gem::Dependency
99
- name: activesupport
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: '4.0'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '4.0'
112
98
  - !ruby/object:Gem::Dependency
113
99
  name: pry
114
100
  requirement: !ruby/object:Gem::Requirement
@@ -158,15 +144,20 @@ files:
158
144
  - bin/install_git_hooks
159
145
  - bin/setup
160
146
  - lib/telegram/bot/types.rb
147
+ - lib/telegram/bot/types/animation.rb
161
148
  - lib/telegram/bot/types/audio.rb
162
149
  - lib/telegram/bot/types/base.rb
150
+ - lib/telegram/bot/types/callback_game.rb
163
151
  - lib/telegram/bot/types/callback_query.rb
164
152
  - lib/telegram/bot/types/chat.rb
153
+ - lib/telegram/bot/types/chat_member.rb
165
154
  - lib/telegram/bot/types/chosen_inline_result.rb
166
155
  - lib/telegram/bot/types/contact.rb
167
156
  - lib/telegram/bot/types/document.rb
168
157
  - lib/telegram/bot/types/file.rb
169
158
  - lib/telegram/bot/types/force_reply.rb
159
+ - lib/telegram/bot/types/game.rb
160
+ - lib/telegram/bot/types/game_high_score.rb
170
161
  - lib/telegram/bot/types/inline_keyboard_button.rb
171
162
  - lib/telegram/bot/types/inline_keyboard_markup.rb
172
163
  - lib/telegram/bot/types/inline_query.rb
@@ -182,6 +173,7 @@ files:
182
173
  - lib/telegram/bot/types/inline_query_result_cached_voice.rb
183
174
  - lib/telegram/bot/types/inline_query_result_contact.rb
184
175
  - lib/telegram/bot/types/inline_query_result_document.rb
176
+ - lib/telegram/bot/types/inline_query_result_game.rb
185
177
  - lib/telegram/bot/types/inline_query_result_gif.rb
186
178
  - lib/telegram/bot/types/inline_query_result_location.rb
187
179
  - lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb
@@ -194,20 +186,29 @@ files:
194
186
  - lib/telegram/bot/types/input_message_content.rb
195
187
  - lib/telegram/bot/types/input_text_message_content.rb
196
188
  - lib/telegram/bot/types/input_venue_message_content.rb
189
+ - lib/telegram/bot/types/invoice.rb
197
190
  - lib/telegram/bot/types/keyboard_button.rb
191
+ - lib/telegram/bot/types/labeled_price.rb
198
192
  - lib/telegram/bot/types/location.rb
199
193
  - lib/telegram/bot/types/message.rb
200
194
  - lib/telegram/bot/types/message_entity.rb
195
+ - lib/telegram/bot/types/order_info.rb
201
196
  - lib/telegram/bot/types/photo_size.rb
202
- - lib/telegram/bot/types/reply_keyboard_hide.rb
197
+ - lib/telegram/bot/types/pre_checkout_query.rb
203
198
  - lib/telegram/bot/types/reply_keyboard_markup.rb
199
+ - lib/telegram/bot/types/reply_keyboard_remove.rb
200
+ - lib/telegram/bot/types/shipping_address.rb
201
+ - lib/telegram/bot/types/shipping_option.rb
202
+ - lib/telegram/bot/types/shipping_query.rb
204
203
  - lib/telegram/bot/types/sticker.rb
204
+ - lib/telegram/bot/types/successful_payment.rb
205
205
  - lib/telegram/bot/types/update.rb
206
206
  - lib/telegram/bot/types/user.rb
207
207
  - lib/telegram/bot/types/user_profile_photos.rb
208
208
  - lib/telegram/bot/types/venue.rb
209
209
  - lib/telegram/bot/types/version.rb
210
210
  - lib/telegram/bot/types/video.rb
211
+ - lib/telegram/bot/types/video_note.rb
211
212
  - lib/telegram/bot/types/voice.rb
212
213
  - telegram-bot-types.gemspec
213
214
  homepage: https://github.com/telegram-bot-rb/telegram-bot-types
@@ -230,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
231
  version: '0'
231
232
  requirements: []
232
233
  rubyforge_project:
233
- rubygems_version: 2.5.1
234
+ rubygems_version: 2.6.8
234
235
  signing_key:
235
236
  specification_version: 4
236
237
  summary: Virtus types for Telegram Bot API