telegram-bot-ruby 0.15.0 → 0.18.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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/CHANGELOG.md +18 -0
  4. data/lib/telegram/bot/api.rb +10 -40
  5. data/lib/telegram/bot/types/base.rb +1 -0
  6. data/lib/telegram/bot/types/bot_command.rb +10 -0
  7. data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +9 -0
  8. data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +9 -0
  9. data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +9 -0
  10. data/lib/telegram/bot/types/bot_command_scope_chat.rb +10 -0
  11. data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +10 -0
  12. data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +11 -0
  13. data/lib/telegram/bot/types/bot_command_scope_default.rb +9 -0
  14. data/lib/telegram/bot/types/chat.rb +8 -1
  15. data/lib/telegram/bot/types/chat_invite_link.rb +3 -0
  16. data/lib/telegram/bot/types/chat_join_request.rb +13 -0
  17. data/lib/telegram/bot/types/compactable.rb +5 -1
  18. data/lib/telegram/bot/types/force_reply.rb +1 -0
  19. data/lib/telegram/bot/types/inline_query.rb +2 -1
  20. data/lib/telegram/bot/types/input_invoice_message_content.rb +28 -0
  21. data/lib/telegram/bot/types/message.rb +9 -6
  22. data/lib/telegram/bot/types/pattern_matching.rb +11 -0
  23. data/lib/telegram/bot/types/reply_keyboard_markup.rb +1 -0
  24. data/lib/telegram/bot/types/sticker.rb +1 -0
  25. data/lib/telegram/bot/types/sticker_set.rb +1 -0
  26. data/lib/telegram/bot/types/update.rb +1 -0
  27. data/lib/telegram/bot/types/voice_chat_scheduled.rb +9 -0
  28. data/lib/telegram/bot/types.rb +14 -2
  29. data/lib/telegram/bot/version.rb +1 -1
  30. data/lib/telegram/bot.rb +0 -1
  31. data/telegram-bot-ruby.gemspec +3 -3
  32. metadata +24 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b39d62dd4efff4ab96664e0cc4a0ce3eee6631ea8b96c3b90be993f8bae6d34
4
- data.tar.gz: e7afcb7986690e5e512faa9caec4abe13f85e21252e86f13af48968ae990bca0
3
+ metadata.gz: 8926e9101b449b8f38edab0c8497cb950d7806ac8e7762fa016875c557fa8f4f
4
+ data.tar.gz: 672f59e2be73cac12311244402960e84f14cd8c206891b33b33eca5adb8d89e9
5
5
  SHA512:
6
- metadata.gz: 527a11835b057bc29fdbeecd22350b86b1f3bfdd9bc3c328e11b5fe275fd47847c946bc4bf7b3f804f25b9f9dee8a693c54bb3d6ebf8d64a1a009995b59d03e9
7
- data.tar.gz: 839b7b1c0c03c4109ebcdc6f777af0f90013393f35407b113c6805d7740bc9326dc2e4236b465f76387db38656832aa615178bcc96b5c13a0fdb1ebbbedbc356
6
+ metadata.gz: ff205984af1416bac8ee5919fdf9dbf72d042beb6e7e92df8aaab8dd824d4d087a9b71d603133dfbd9cfafc8c9b0ee71e066a587f674905a6828e64e96abb398
7
+ data.tar.gz: 8792c770b06c84b38f72b32716c01aa8dd207dffb72c2937387630f1a8e7e7c522c85c5f30ece246c6384c4e546b2b8433b07702c250d79331da97d71e1839e0
data/.rubocop.yml CHANGED
@@ -10,6 +10,7 @@ Metrics/BlockLength:
10
10
  - describe
11
11
 
12
12
  Metrics/LineLength:
13
+ Max: 120
13
14
  Exclude:
14
15
  - telegram-bot-ruby.gemspec
15
16
  - examples/*.rb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.0
4
+
5
+ - Implement [Bot API 5.2](https://core.telegram.org/bots/api-changelog#april-26-2021)
6
+ - Implement [Bot API 5.3](https://core.telegram.org/bots/api-changelog#june-25-2021)
7
+ - Implement [Bot API 5.4](https://core.telegram.org/bots/api-changelog#november-5-2021)
8
+ - Implement [Bot API 5.5](https://core.telegram.org/bots/api-changelog#december-7-2021)
9
+ - Implement [Bot API 5.6](https://core.telegram.org/bots/api-changelog#december-30-2021)
10
+ - Implement [Bot API 5.7](https://core.telegram.org/bots/api-changelog#january-31-2022)
11
+
12
+ ## 0.17.0
13
+
14
+ - Pin `faraday` to 1.0
15
+
16
+ ## 0.16.0
17
+
18
+ - Replace `inflecto` with `dry-inflector`
19
+ - Update `virtus` up to 2.0
20
+
3
21
  ## 0.15.0
4
22
 
5
23
  - Implement [Bot API 5.1](https://core.telegram.org/bots/api#march-9-2021)
@@ -1,6 +1,6 @@
1
1
  module Telegram
2
2
  module Bot
3
- class Api # rubocop:disable ClassLength
3
+ class Api
4
4
  ENDPOINTS = %w[
5
5
  getUpdates setWebhook deleteWebhook getWebhookInfo getMe sendMessage
6
6
  forwardMessage sendPhoto sendAudio sendDocument sendVideo sendVoice
@@ -19,36 +19,10 @@ module Telegram
19
19
  sendGame setGameScore getGameHighScores setPassportDataErrors
20
20
  editMessageMedia sendAnimation sendPoll stopPoll setChatPermissions
21
21
  setChatAdministratorCustomTitle sendDice getMyCommands setMyCommands
22
- setStickerSetThumb logOut close copyMessage createChatInviteLink
23
- editChatInviteLink revokeChatInviteLink
24
- ].freeze
25
- REPLY_MARKUP_TYPES = [
26
- Telegram::Bot::Types::ReplyKeyboardMarkup,
27
- Telegram::Bot::Types::ReplyKeyboardRemove,
28
- Telegram::Bot::Types::ForceReply,
29
- Telegram::Bot::Types::InlineKeyboardMarkup
30
- ].freeze
31
- INLINE_QUERY_RESULT_TYPES = [
32
- Telegram::Bot::Types::InlineQueryResultArticle,
33
- Telegram::Bot::Types::InlineQueryResultPhoto,
34
- Telegram::Bot::Types::InlineQueryResultGif,
35
- Telegram::Bot::Types::InlineQueryResultMpeg4Gif,
36
- Telegram::Bot::Types::InlineQueryResultVideo,
37
- Telegram::Bot::Types::InlineQueryResultAudio,
38
- Telegram::Bot::Types::InlineQueryResultVoice,
39
- Telegram::Bot::Types::InlineQueryResultDocument,
40
- Telegram::Bot::Types::InlineQueryResultLocation,
41
- Telegram::Bot::Types::InlineQueryResultVenue,
42
- Telegram::Bot::Types::InlineQueryResultContact,
43
- Telegram::Bot::Types::InlineQueryResultGame,
44
- Telegram::Bot::Types::InlineQueryResultCachedPhoto,
45
- Telegram::Bot::Types::InlineQueryResultCachedGif,
46
- Telegram::Bot::Types::InlineQueryResultCachedMpeg4Gif,
47
- Telegram::Bot::Types::InlineQueryResultCachedSticker,
48
- Telegram::Bot::Types::InlineQueryResultCachedDocument,
49
- Telegram::Bot::Types::InlineQueryResultCachedVideo,
50
- Telegram::Bot::Types::InlineQueryResultCachedVoice,
51
- Telegram::Bot::Types::InlineQueryResultCachedAudio
22
+ deleteMyCommands setStickerSetThumb logOut close copyMessage
23
+ createChatInviteLink editChatInviteLink revokeChatInviteLink
24
+ approveChatJoinRequest declineChatJoinRequest banChatSenderChat
25
+ unbanChatSenderChat
52
26
  ].freeze
53
27
 
54
28
  attr_reader :token, :url
@@ -92,19 +66,15 @@ module Telegram
92
66
  end
93
67
 
94
68
  def sanitize_value(value)
95
- jsonify_inline_query_results(jsonify_reply_markup(value))
69
+ jsonify_value(value)
96
70
  end
97
71
 
98
- def jsonify_reply_markup(value)
99
- return value unless REPLY_MARKUP_TYPES.any? { |type| value.is_a?(type) }
100
- value.to_compact_hash.to_json
72
+ def jsonify_value(value)
73
+ jsonify_value?(value) ? value.to_json : value
101
74
  end
102
75
 
103
- def jsonify_inline_query_results(value)
104
- return value unless
105
- value.is_a?(Array) &&
106
- value.all? { |i| INLINE_QUERY_RESULT_TYPES.any? { |t| i.is_a?(t) } }
107
- value.map { |i| i.to_compact_hash.select { |_, v| v } }.to_json
76
+ def jsonify_value?(value)
77
+ value.respond_to?(:to_compact_hash) || value.is_a?(Array)
108
78
  end
109
79
 
110
80
  def camelize(method_name)
@@ -4,6 +4,7 @@ module Telegram
4
4
  class Base
5
5
  include Virtus.model
6
6
  include Compactable
7
+ include PatternMatching
7
8
  end
8
9
  end
9
10
  end
@@ -0,0 +1,10 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommand < Base
5
+ attribute :command, String
6
+ attribute :description, String
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommandScopeAllChatAdministrators < Base
5
+ attribute :type, String, default: 'all_chat_administrators'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommandScopeAllGroupChats < Base
5
+ attribute :type, String, default: 'all_group_chats'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommandScopeAllPrivateChats < Base
5
+ attribute :type, String, default: 'all_private_chats'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommandScopeChat < Base
5
+ attribute :type, String, default: 'chat'
6
+ attribute :chat_id, String
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommandScopeChatAdministrators < Base
5
+ attribute :type, String, default: 'chat_administrators'
6
+ attribute :chat_id, String
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommandScopeChatMember < Base
5
+ attribute :type, String, default: 'chat_member'
6
+ attribute :chat_id, String
7
+ attribute :user_id, Integer
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class BotCommandScopeDefault < Base
5
+ attribute :type, String, default: 'default'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -4,6 +4,7 @@ module Telegram
4
4
  class Chat
5
5
  include Virtus.model(finalize: false)
6
6
  include Compactable
7
+ include PatternMatching
7
8
 
8
9
  attribute :id, Integer
9
10
  attribute :type, String
@@ -11,15 +12,21 @@ module Telegram
11
12
  attribute :username, String
12
13
  attribute :first_name, String
13
14
  attribute :last_name, String
14
- attribute :all_members_are_administrators, Boolean
15
15
  attribute :photo, ChatPhoto
16
+ attribute :bio, String
17
+ attribute :has_private_forwards, Boolean
16
18
  attribute :description, String
17
19
  attribute :invite_link, String
18
20
  attribute :pinned_message, 'Telegram::Bot::Types::Message'
19
21
  attribute :permissions, ChatPermissions
20
22
  attribute :slow_mode_delay, Integer
23
+ attribute :message_auto_delete_time, Integer
24
+ attribute :has_protected_content, Boolean
21
25
  attribute :sticker_set_name, String
22
26
  attribute :can_set_sticker_set, Boolean
27
+ attribute :all_members_are_administrators, Boolean
28
+ attribute :linked_chat_id, Integer
29
+ attribute :location, ChatLocation
23
30
  end
24
31
  end
25
32
  end
@@ -4,10 +4,13 @@ module Telegram
4
4
  class ChatInviteLink < Base
5
5
  attribute :invite_link, String
6
6
  attribute :creator, User
7
+ attribute :creates_join_request, Boolean
7
8
  attribute :is_primary, Boolean
8
9
  attribute :is_revoked, Boolean
10
+ attribute :name, String
9
11
  attribute :expire_date, Integer
10
12
  attribute :member_limit, Integer
13
+ attribute :pending_join_request_count, Integer
11
14
  end
12
15
  end
13
16
  end
@@ -0,0 +1,13 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class ChatJoinRequest < Base
5
+ attribute :chat, Chat
6
+ attribute :from, User
7
+ attribute :date, Integer
8
+ attribute :bio, String
9
+ attribute :invite_link, ChatInviteLink
10
+ end
11
+ end
12
+ end
13
+ end
@@ -5,7 +5,7 @@ module Telegram
5
5
  def to_compact_hash
6
6
  Hash[attributes.dup.delete_if { |_, v| v.nil? }.map do |key, value|
7
7
  value =
8
- if value.class.ancestors.include?(Telegram::Bot::Types::Base)
8
+ if value.respond_to?(:to_compact_hash)
9
9
  value.to_compact_hash
10
10
  else
11
11
  value
@@ -14,6 +14,10 @@ module Telegram
14
14
  [key, value]
15
15
  end]
16
16
  end
17
+
18
+ def to_json(*args)
19
+ to_compact_hash.select { |_, v| v }.to_json(*args)
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -3,6 +3,7 @@ module Telegram
3
3
  module Types
4
4
  class ForceReply < Base
5
5
  attribute :force_reply, Boolean
6
+ attribute :input_field_placeholder, String
6
7
  attribute :selective, Boolean, default: false
7
8
  end
8
9
  end
@@ -4,9 +4,10 @@ module Telegram
4
4
  class InlineQuery < Base
5
5
  attribute :id, String
6
6
  attribute :from, User
7
- attribute :location, Location
8
7
  attribute :query, String
9
8
  attribute :offset, String
9
+ attribute :chat_type, String
10
+ attribute :location, Location
10
11
 
11
12
  alias to_s query
12
13
  end
@@ -0,0 +1,28 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class InputInvoiceMessageContent < InputMessageContent
5
+ attribute :title, String
6
+ attribute :description, String
7
+ attribute :payload, String
8
+ attribute :provider_token, String
9
+ attribute :currency, String
10
+ attribute :prices, Array[LabeledPrice]
11
+ attribute :max_tip_amount, Integer
12
+ attribute :suggested_tip_amounts, Array[Integer]
13
+ attribute :provider_data, String
14
+ attribute :photo_url, String
15
+ attribute :photo_size, Integer
16
+ attribute :photo_width, Integer
17
+ attribute :photo_height, Integer
18
+ attribute :need_name, Boolean
19
+ attribute :need_phone_number, Boolean
20
+ attribute :need_email, Boolean
21
+ attribute :need_shipping_address, Boolean
22
+ attribute :send_phone_number_to_provider, Boolean
23
+ attribute :send_email_to_provider, Boolean
24
+ attribute :is_flexible, Boolean
25
+ end
26
+ end
27
+ end
28
+ end
@@ -13,29 +13,31 @@ module Telegram
13
13
  attribute :forward_signature, String
14
14
  attribute :forward_sender_name, String
15
15
  attribute :forward_date, Integer
16
+ attribute :is_automatic_forward, Boolean
16
17
  attribute :reply_to_message, Message
17
18
  attribute :via_bot, User
18
19
  attribute :edit_date, Integer
20
+ attribute :has_protected_content, Boolean
19
21
  attribute :media_group_id, String
20
22
  attribute :author_signature, String
21
23
  attribute :text, String
22
24
  attribute :entities, Array[MessageEntity]
23
- attribute :caption_entities, Array[MessageEntity]
25
+ attribute :animation, Animation
24
26
  attribute :audio, Audio
25
27
  attribute :document, Document
26
- attribute :animation, Animation
27
- attribute :game, Game
28
28
  attribute :photo, Array[PhotoSize]
29
29
  attribute :sticker, Sticker
30
30
  attribute :video, Video
31
- attribute :voice, Voice
32
31
  attribute :video_note, VideoNote
32
+ attribute :voice, Voice
33
33
  attribute :caption, String
34
+ attribute :caption_entities, Array[MessageEntity]
34
35
  attribute :contact, Contact
35
36
  attribute :dice, Dice
36
- attribute :location, Location
37
- attribute :venue, Venue
37
+ attribute :game, Game
38
38
  attribute :poll, Poll
39
+ attribute :venue, Venue
40
+ attribute :location, Location
39
41
  attribute :new_chat_members, Array[User]
40
42
  attribute :left_chat_member, User
41
43
  attribute :new_chat_title, String
@@ -53,6 +55,7 @@ module Telegram
53
55
  attribute :connected_website, String
54
56
  attribute :passport_data, PassportData
55
57
  attribute :proximity_alert_triggered, ProximityAlertTriggered
58
+ attribute :voice_chat_scheduled, VoiceChatScheduled
56
59
  attribute :voice_chat_started, VoiceChatStarted
57
60
  attribute :voice_chat_ended, VoiceChatEnded
58
61
  attribute :voice_chat_participants_invited, VoiceChatParticipantsInvited
@@ -0,0 +1,11 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ module PatternMatching
5
+ def deconstruct_keys(_keys)
6
+ attributes
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -5,6 +5,7 @@ module Telegram
5
5
  attribute :keyboard, Array[Array[KeyboardButton]]
6
6
  attribute :resize_keyboard, Boolean, default: false
7
7
  attribute :one_time_keyboard, Boolean, default: false
8
+ attribute :input_field_placeholder, String
8
9
  attribute :selective, Boolean, default: false
9
10
 
10
11
  def to_compact_hash
@@ -7,6 +7,7 @@ module Telegram
7
7
  attribute :width, Integer
8
8
  attribute :height, Integer
9
9
  attribute :is_animated, Boolean
10
+ attribute :is_video, Boolean
10
11
  attribute :thumb, PhotoSize
11
12
  attribute :emoji, String
12
13
  attribute :set_name, String
@@ -5,6 +5,7 @@ module Telegram
5
5
  attribute :name, String
6
6
  attribute :title, String
7
7
  attribute :is_animated, Boolean
8
+ attribute :is_video, Boolean
8
9
  attribute :contains_masks, Boolean
9
10
  attribute :stickers, Array[Sticker]
10
11
  attribute :thumb, PhotoSize
@@ -16,6 +16,7 @@ module Telegram
16
16
  attribute :poll_answer, PollAnswer
17
17
  attribute :my_chat_member, ChatMemberUpdated
18
18
  attribute :chat_member, ChatMemberUpdated
19
+ attribute :chat_join_request, ChatJoinRequest
19
20
 
20
21
  def current_message
21
22
  @current_message ||=
@@ -0,0 +1,9 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class VoiceChatScheduled < Base
5
+ attribute :start_date, Integer
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,4 +1,5 @@
1
1
  require 'telegram/bot/types/compactable'
2
+ require 'telegram/bot/types/pattern_matching'
2
3
  require 'telegram/bot/types/base'
3
4
  require 'telegram/bot/types/user'
4
5
  require 'telegram/bot/types/photo_size'
@@ -15,6 +16,7 @@ require 'telegram/bot/types/dice'
15
16
  require 'telegram/bot/types/location'
16
17
  require 'telegram/bot/types/chat_photo'
17
18
  require 'telegram/bot/types/chat_permissions'
19
+ require 'telegram/bot/types/chat_location'
18
20
  require 'telegram/bot/types/chat'
19
21
  require 'telegram/bot/types/message_entity'
20
22
  require 'telegram/bot/types/venue'
@@ -42,8 +44,10 @@ require 'telegram/bot/types/passport_element_error_files'
42
44
  require 'telegram/bot/types/passport_element_error_translation_file'
43
45
  require 'telegram/bot/types/passport_element_error_translation_files'
44
46
  require 'telegram/bot/types/passport_element_error_unspecified'
47
+ require 'telegram/bot/types/labeled_price'
45
48
  require 'telegram/bot/types/input_message_content'
46
49
  require 'telegram/bot/types/input_contact_message_content'
50
+ require 'telegram/bot/types/input_invoice_message_content'
47
51
  require 'telegram/bot/types/input_location_message_content'
48
52
  require 'telegram/bot/types/input_text_message_content'
49
53
  require 'telegram/bot/types/input_venue_message_content'
@@ -73,6 +77,7 @@ require 'telegram/bot/types/inline_query_result_video'
73
77
  require 'telegram/bot/types/inline_query_result_voice'
74
78
  require 'telegram/bot/types/chosen_inline_result'
75
79
  require 'telegram/bot/types/proximity_alert_triggered'
80
+ require 'telegram/bot/types/voice_chat_scheduled'
76
81
  require 'telegram/bot/types/voice_chat_started'
77
82
  require 'telegram/bot/types/voice_chat_ended'
78
83
  require 'telegram/bot/types/voice_chat_participants_invited'
@@ -87,11 +92,11 @@ require 'telegram/bot/types/reply_keyboard_markup'
87
92
  require 'telegram/bot/types/reply_keyboard_remove'
88
93
  require 'telegram/bot/types/force_reply'
89
94
  require 'telegram/bot/types/file'
90
- require 'telegram/bot/types/labeled_price'
91
95
  require 'telegram/bot/types/shipping_option'
92
96
  require 'telegram/bot/types/chat_invite_link'
93
97
  require 'telegram/bot/types/chat_member'
94
98
  require 'telegram/bot/types/chat_member_updated'
99
+ require 'telegram/bot/types/chat_join_request'
95
100
  require 'telegram/bot/types/update'
96
101
  require 'telegram/bot/types/user_profile_photos'
97
102
  require 'telegram/bot/types/input_media_photo'
@@ -100,6 +105,13 @@ require 'telegram/bot/types/input_media_animation'
100
105
  require 'telegram/bot/types/input_media_audio'
101
106
  require 'telegram/bot/types/input_media_document'
102
107
  require 'telegram/bot/types/webhook_info'
103
- require 'telegram/bot/types/chat_location'
108
+ require 'telegram/bot/types/bot_command'
109
+ require 'telegram/bot/types/bot_command_scope_all_chat_administrators'
110
+ require 'telegram/bot/types/bot_command_scope_all_group_chats'
111
+ require 'telegram/bot/types/bot_command_scope_all_private_chats'
112
+ require 'telegram/bot/types/bot_command_scope_chat_administrators'
113
+ require 'telegram/bot/types/bot_command_scope_chat_member'
114
+ require 'telegram/bot/types/bot_command_scope_chat'
115
+ require 'telegram/bot/types/bot_command_scope_default'
104
116
 
105
117
  Virtus.finalize
@@ -1,5 +1,5 @@
1
1
  module Telegram
2
2
  module Bot
3
- VERSION = '0.15.0'.freeze
3
+ VERSION = '0.18.0'.freeze
4
4
  end
5
5
  end
data/lib/telegram/bot.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'virtus'
2
- require 'inflecto'
3
2
  require 'logger'
4
3
  require 'json'
5
4
  require 'faraday'
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_dependency 'faraday'
21
- spec.add_dependency 'virtus'
22
- spec.add_dependency 'inflecto'
20
+ spec.add_dependency 'faraday', '~> 1.0'
21
+ spec.add_dependency 'virtus', '~> 2.0'
22
+ spec.add_dependency 'dry-inflector'
23
23
 
24
24
  spec.add_development_dependency 'rake', '~> 13.0'
25
25
  spec.add_development_dependency 'pry'
metadata CHANGED
@@ -1,45 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.18.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: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2022-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: virtus
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: inflecto
42
+ name: dry-inflector
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -153,10 +153,19 @@ files:
153
153
  - lib/telegram/bot/types/animation.rb
154
154
  - lib/telegram/bot/types/audio.rb
155
155
  - lib/telegram/bot/types/base.rb
156
+ - lib/telegram/bot/types/bot_command.rb
157
+ - lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb
158
+ - lib/telegram/bot/types/bot_command_scope_all_group_chats.rb
159
+ - lib/telegram/bot/types/bot_command_scope_all_private_chats.rb
160
+ - lib/telegram/bot/types/bot_command_scope_chat.rb
161
+ - lib/telegram/bot/types/bot_command_scope_chat_administrators.rb
162
+ - lib/telegram/bot/types/bot_command_scope_chat_member.rb
163
+ - lib/telegram/bot/types/bot_command_scope_default.rb
156
164
  - lib/telegram/bot/types/callback_game.rb
157
165
  - lib/telegram/bot/types/callback_query.rb
158
166
  - lib/telegram/bot/types/chat.rb
159
167
  - lib/telegram/bot/types/chat_invite_link.rb
168
+ - lib/telegram/bot/types/chat_join_request.rb
160
169
  - lib/telegram/bot/types/chat_location.rb
161
170
  - lib/telegram/bot/types/chat_member.rb
162
171
  - lib/telegram/bot/types/chat_member_updated.rb
@@ -197,6 +206,7 @@ files:
197
206
  - lib/telegram/bot/types/inline_query_result_video.rb
198
207
  - lib/telegram/bot/types/inline_query_result_voice.rb
199
208
  - lib/telegram/bot/types/input_contact_message_content.rb
209
+ - lib/telegram/bot/types/input_invoice_message_content.rb
200
210
  - lib/telegram/bot/types/input_location_message_content.rb
201
211
  - lib/telegram/bot/types/input_media_animation.rb
202
212
  - lib/telegram/bot/types/input_media_audio.rb
@@ -228,6 +238,7 @@ files:
228
238
  - lib/telegram/bot/types/passport_element_error_translation_files.rb
229
239
  - lib/telegram/bot/types/passport_element_error_unspecified.rb
230
240
  - lib/telegram/bot/types/passport_file.rb
241
+ - lib/telegram/bot/types/pattern_matching.rb
231
242
  - lib/telegram/bot/types/photo_size.rb
232
243
  - lib/telegram/bot/types/poll.rb
233
244
  - lib/telegram/bot/types/poll_answer.rb
@@ -251,6 +262,7 @@ files:
251
262
  - lib/telegram/bot/types/voice.rb
252
263
  - lib/telegram/bot/types/voice_chat_ended.rb
253
264
  - lib/telegram/bot/types/voice_chat_participants_invited.rb
265
+ - lib/telegram/bot/types/voice_chat_scheduled.rb
254
266
  - lib/telegram/bot/types/voice_chat_started.rb
255
267
  - lib/telegram/bot/types/webhook_info.rb
256
268
  - lib/telegram/bot/version.rb
@@ -273,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
285
  - !ruby/object:Gem::Version
274
286
  version: '0'
275
287
  requirements: []
276
- rubygems_version: 3.2.3
288
+ rubygems_version: 3.3.3
277
289
  signing_key:
278
290
  specification_version: 4
279
291
  summary: Ruby wrapper for Telegram's Bot API