telegram-bot-ruby 1.0.0.rc1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +10 -0
  3. data/.github/workflows/ci.yml +2 -5
  4. data/.github/workflows/stale.yml +19 -0
  5. data/.gitignore +1 -0
  6. data/.rspec +1 -0
  7. data/.rubocop.yml +12 -7
  8. data/CHANGELOG.md +17 -0
  9. data/Gemfile +13 -0
  10. data/LICENSE +0 -1
  11. data/README.md +78 -19
  12. data/Rakefile +10 -8
  13. data/bin/console +4 -1
  14. data/lib/telegram/bot/api/endpoints.rb +114 -0
  15. data/lib/telegram/bot/api.rb +20 -44
  16. data/lib/telegram/bot/client.rb +8 -9
  17. data/lib/telegram/bot/exceptions/response_error.rb +2 -8
  18. data/lib/telegram/bot/types/animation.rb +1 -1
  19. data/lib/telegram/bot/types/audio.rb +1 -1
  20. data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +1 -1
  21. data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +1 -1
  22. data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +1 -1
  23. data/lib/telegram/bot/types/bot_command_scope_chat.rb +2 -2
  24. data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +2 -2
  25. data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +2 -2
  26. data/lib/telegram/bot/types/bot_command_scope_default.rb +1 -1
  27. data/lib/telegram/bot/types/bot_description.rb +11 -0
  28. data/lib/telegram/bot/types/bot_name.rb +11 -0
  29. data/lib/telegram/bot/types/bot_short_description.rb +11 -0
  30. data/lib/telegram/bot/types/callback_query.rb +1 -1
  31. data/lib/telegram/bot/types/chat.rb +16 -9
  32. data/lib/telegram/bot/types/chat_administrator_rights.rb +3 -0
  33. data/lib/telegram/bot/types/chat_boost.rb +14 -0
  34. data/lib/telegram/bot/types/chat_boost_removed.rb +14 -0
  35. data/lib/telegram/bot/types/chat_boost_source.rb +13 -0
  36. data/lib/telegram/bot/types/chat_boost_source_gift_code.rb +12 -0
  37. data/lib/telegram/bot/types/chat_boost_source_giveaway.rb +14 -0
  38. data/lib/telegram/bot/types/chat_boost_source_premium.rb +12 -0
  39. data/lib/telegram/bot/types/chat_boost_updated.rb +12 -0
  40. data/lib/telegram/bot/types/chat_join_request.rb +1 -0
  41. data/lib/telegram/bot/types/chat_member.rb +11 -2
  42. data/lib/telegram/bot/types/chat_member_administrator.rb +8 -5
  43. data/lib/telegram/bot/types/chat_member_banned.rb +2 -2
  44. data/lib/telegram/bot/types/chat_member_left.rb +2 -2
  45. data/lib/telegram/bot/types/chat_member_member.rb +2 -2
  46. data/lib/telegram/bot/types/chat_member_owner.rb +2 -2
  47. data/lib/telegram/bot/types/chat_member_restricted.rb +12 -7
  48. data/lib/telegram/bot/types/chat_member_updated.rb +1 -0
  49. data/lib/telegram/bot/types/chat_permissions.rb +6 -1
  50. data/lib/telegram/bot/types/chat_shared.rb +12 -0
  51. data/lib/telegram/bot/types/compactable.rb +2 -7
  52. data/lib/telegram/bot/types/document.rb +1 -1
  53. data/lib/telegram/bot/types/external_reply_info.rb +33 -0
  54. data/lib/telegram/bot/types/force_reply.rb +1 -1
  55. data/lib/telegram/bot/types/giveaway.rb +18 -0
  56. data/lib/telegram/bot/types/giveaway_completed.rb +13 -0
  57. data/lib/telegram/bot/types/giveaway_created.rb +10 -0
  58. data/lib/telegram/bot/types/giveaway_winners.rb +21 -0
  59. data/lib/telegram/bot/types/inaccessible_message.rb +13 -0
  60. data/lib/telegram/bot/types/inline_keyboard_button.rb +1 -0
  61. data/lib/telegram/bot/types/inline_query_result_article.rb +4 -4
  62. data/lib/telegram/bot/types/inline_query_result_audio.rb +1 -1
  63. data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +1 -1
  64. data/lib/telegram/bot/types/inline_query_result_cached_document.rb +1 -1
  65. data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +1 -1
  66. data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +1 -1
  67. data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +1 -1
  68. data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +1 -1
  69. data/lib/telegram/bot/types/inline_query_result_cached_video.rb +1 -1
  70. data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +1 -1
  71. data/lib/telegram/bot/types/inline_query_result_contact.rb +4 -4
  72. data/lib/telegram/bot/types/inline_query_result_document.rb +4 -4
  73. data/lib/telegram/bot/types/inline_query_result_game.rb +1 -1
  74. data/lib/telegram/bot/types/inline_query_result_gif.rb +3 -3
  75. data/lib/telegram/bot/types/inline_query_result_location.rb +4 -4
  76. data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +3 -3
  77. data/lib/telegram/bot/types/inline_query_result_photo.rb +2 -2
  78. data/lib/telegram/bot/types/inline_query_result_venue.rb +4 -4
  79. data/lib/telegram/bot/types/inline_query_result_video.rb +2 -2
  80. data/lib/telegram/bot/types/inline_query_result_voice.rb +1 -1
  81. data/lib/telegram/bot/types/input_media_animation.rb +2 -2
  82. data/lib/telegram/bot/types/input_media_audio.rb +2 -2
  83. data/lib/telegram/bot/types/input_media_document.rb +2 -2
  84. data/lib/telegram/bot/types/input_media_photo.rb +1 -1
  85. data/lib/telegram/bot/types/input_media_video.rb +2 -2
  86. data/lib/telegram/bot/types/input_text_message_content.rb +1 -1
  87. data/lib/telegram/bot/types/keyboard_button.rb +2 -0
  88. data/lib/telegram/bot/types/keyboard_button_request_chat.rb +18 -0
  89. data/lib/telegram/bot/types/keyboard_button_request_users.rb +14 -0
  90. data/lib/telegram/bot/types/link_preview_options.rb +15 -0
  91. data/lib/telegram/bot/types/maybe_inaccessible_message.rb +12 -0
  92. data/lib/telegram/bot/types/menu_button_commands.rb +1 -1
  93. data/lib/telegram/bot/types/menu_button_default.rb +1 -1
  94. data/lib/telegram/bot/types/menu_button_web_app.rb +1 -1
  95. data/lib/telegram/bot/types/message.rb +20 -15
  96. data/lib/telegram/bot/types/message_id.rb +11 -0
  97. data/lib/telegram/bot/types/message_origin.rb +14 -0
  98. data/lib/telegram/bot/types/message_origin_channel.rb +15 -0
  99. data/lib/telegram/bot/types/message_origin_chat.rb +14 -0
  100. data/lib/telegram/bot/types/message_origin_hidden_user.rb +13 -0
  101. data/lib/telegram/bot/types/message_origin_user.rb +13 -0
  102. data/lib/telegram/bot/types/message_reaction_count_updated.rb +14 -0
  103. data/lib/telegram/bot/types/message_reaction_updated.rb +17 -0
  104. data/lib/telegram/bot/types/passport_element_error_data_field.rb +1 -1
  105. data/lib/telegram/bot/types/passport_element_error_file.rb +1 -1
  106. data/lib/telegram/bot/types/passport_element_error_files.rb +2 -2
  107. data/lib/telegram/bot/types/passport_element_error_front_side.rb +1 -1
  108. data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +1 -1
  109. data/lib/telegram/bot/types/passport_element_error_selfie.rb +1 -1
  110. data/lib/telegram/bot/types/passport_element_error_translation_file.rb +1 -1
  111. data/lib/telegram/bot/types/passport_element_error_translation_files.rb +2 -2
  112. data/lib/telegram/bot/types/passport_element_error_unspecified.rb +1 -1
  113. data/lib/telegram/bot/types/poll_answer.rb +2 -1
  114. data/lib/telegram/bot/types/reaction_count.rb +12 -0
  115. data/lib/telegram/bot/types/reaction_type.rb +12 -0
  116. data/lib/telegram/bot/types/reaction_type_custom_emoji.rb +12 -0
  117. data/lib/telegram/bot/types/reaction_type_emoji.rb +12 -0
  118. data/lib/telegram/bot/types/reply_keyboard_remove.rb +1 -1
  119. data/lib/telegram/bot/types/reply_parameters.rb +17 -0
  120. data/lib/telegram/bot/types/sticker.rb +2 -1
  121. data/lib/telegram/bot/types/sticker_set.rb +1 -1
  122. data/lib/telegram/bot/types/story.rb +9 -0
  123. data/lib/telegram/bot/types/switch_inline_query_chosen_chat.rb +15 -0
  124. data/lib/telegram/bot/types/text_quote.rb +14 -0
  125. data/lib/telegram/bot/types/update.rb +4 -0
  126. data/lib/telegram/bot/types/user.rb +2 -2
  127. data/lib/telegram/bot/types/user_chat_boosts.rb +11 -0
  128. data/lib/telegram/bot/types/users_shared.rb +12 -0
  129. data/lib/telegram/bot/types/video.rb +1 -1
  130. data/lib/telegram/bot/types/video_note.rb +1 -1
  131. data/lib/telegram/bot/types/webhook_info.rb +1 -1
  132. data/lib/telegram/bot/types/write_access_allowed.rb +3 -0
  133. data/lib/telegram/bot/version.rb +1 -1
  134. data/lib/telegram/bot.rb +1 -0
  135. data/telegram-bot-ruby.gemspec +1 -13
  136. metadata +47 -117
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class MessageOriginHiddenUser < Base
7
+ attribute :type, Types::String.constrained(eql: 'hidden_user').default('hidden_user')
8
+ attribute :date, Types::Integer
9
+ attribute :sender_user_name, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class MessageOriginUser < Base
7
+ attribute :type, Types::String.constrained(eql: 'user').default('user')
8
+ attribute :date, Types::Integer
9
+ attribute :sender_user, User
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class MessageReactionCountUpdated < Base
7
+ attribute :chat, Chat
8
+ attribute :message_id, Types::Integer
9
+ attribute :date, Types::Integer
10
+ attribute :reactions, Types::Array.of(ReactionCount)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class MessageReactionUpdated < Base
7
+ attribute :chat, Chat
8
+ attribute :message_id, Types::Integer
9
+ attribute? :user, User
10
+ attribute? :actor_chat, Chat
11
+ attribute :date, Types::Integer
12
+ attribute :old_reaction, Types::Array.of(ReactionType)
13
+ attribute :new_reaction, Types::Array.of(ReactionType)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorDataField < Base
7
- attribute :source, Types::String.default('data')
7
+ attribute :source, Types::String.constrained(eql: 'data').default('data')
8
8
  attribute :type, Types::String
9
9
  attribute :field_name, Types::String
10
10
  attribute :data_hash, Types::String
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorFile < Base
7
- attribute :source, Types::String.default('file')
7
+ attribute :source, Types::String.constrained(eql: 'file').default('file')
8
8
  attribute :type, Types::String
9
9
  attribute :file_hash, Types::String
10
10
  attribute :message, Types::String
@@ -4,9 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorFiles < Base
7
- attribute :source, Types::String.default('files')
7
+ attribute :source, Types::String.constrained(eql: 'files').default('files')
8
8
  attribute :type, Types::String
9
- attribute :file_hashes, Types::Array.of(String)
9
+ attribute :file_hashes, Types::Array.of(Types::String)
10
10
  attribute :message, Types::String
11
11
  end
12
12
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorFrontSide < Base
7
- attribute :source, Types::String.default('front_side')
7
+ attribute :source, Types::String.constrained(eql: 'front_side').default('front_side')
8
8
  attribute :type, Types::String
9
9
  attribute :file_hash, Types::String
10
10
  attribute :message, Types::String
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorReverseSide < Base
7
- attribute :source, Types::String.default('reverse_side')
7
+ attribute :source, Types::String.constrained(eql: 'reverse_side').default('reverse_side')
8
8
  attribute :type, Types::String
9
9
  attribute :file_hash, Types::String
10
10
  attribute :message, Types::String
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorSelfie < Base
7
- attribute :source, Types::String.default('selfie')
7
+ attribute :source, Types::String.constrained(eql: 'selfie').default('selfie')
8
8
  attribute :type, Types::String
9
9
  attribute :file_hash, Types::String
10
10
  attribute :message, Types::String
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorTranslationFile < Base
7
- attribute :source, Types::String.default('translation_file')
7
+ attribute :source, Types::String.constrained(eql: 'translation_file').default('translation_file')
8
8
  attribute :type, Types::String
9
9
  attribute :file_hash, Types::String
10
10
  attribute :message, Types::String
@@ -4,9 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorTranslationFiles < Base
7
- attribute :source, Types::String.default('translation_files')
7
+ attribute :source, Types::String.constrained(eql: 'translation_files').default('translation_files')
8
8
  attribute :type, Types::String
9
- attribute :file_hashes, Types::Array.of(String)
9
+ attribute :file_hashes, Types::Array.of(Types::String)
10
10
  attribute :message, Types::String
11
11
  end
12
12
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorUnspecified < Base
7
- attribute :source, Types::String.default('unspecified')
7
+ attribute :source, Types::String.constrained(eql: 'unspecified').default('unspecified')
8
8
  attribute :type, Types::String
9
9
  attribute :element_hash, Types::String
10
10
  attribute :message, Types::String
@@ -5,7 +5,8 @@ module Telegram
5
5
  module Types
6
6
  class PollAnswer < Base
7
7
  attribute :poll_id, Types::String
8
- attribute :user, User
8
+ attribute? :voter_chat, Chat
9
+ attribute? :user, User
9
10
  attribute :option_ids, Types::Array.of(Types::Integer)
10
11
  end
11
12
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ReactionCount < Base
7
+ attribute :type, ReactionType
8
+ attribute :total_count, Types::Integer
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ ReactionType = ( # rubocop:disable Naming/ConstantName
7
+ ReactionTypeEmoji |
8
+ ReactionTypeCustomEmoji
9
+ )
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ReactionTypeCustomEmoji < Base
7
+ attribute :type, Types::String.constrained(eql: 'custom_emoji').default('custom_emoji')
8
+ attribute :custom_emoji_id, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ReactionTypeEmoji < Base
7
+ attribute :type, Types::String.constrained(eql: 'emoji').default('emoji')
8
+ attribute :emoji, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ReplyKeyboardRemove < Base
7
- attribute :remove_keyboard, Types::Bool
7
+ attribute :remove_keyboard, Types::True
8
8
  attribute? :selective, Types::Bool.default(false)
9
9
  end
10
10
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ReplyParameters < Base
7
+ attribute :message_id, Types::Integer
8
+ attribute? :chat_id, Types::Integer | Types::String
9
+ attribute? :allow_sending_without_reply, Types::Bool
10
+ attribute? :quote, Types::String
11
+ attribute? :quote_parse_mode, Types::String
12
+ attribute? :quote_entities, Types::Array.of(MessageEntity)
13
+ attribute? :quote_position, Types::Integer
14
+ end
15
+ end
16
+ end
17
+ end
@@ -11,12 +11,13 @@ module Telegram
11
11
  attribute :height, Types::Integer
12
12
  attribute :is_animated, Types::Bool
13
13
  attribute :is_video, Types::Bool
14
- attribute? :thumb, PhotoSize
14
+ attribute? :thumbnail, PhotoSize
15
15
  attribute? :emoji, Types::String
16
16
  attribute? :set_name, Types::String
17
17
  attribute? :premium_animation, File
18
18
  attribute? :mask_position, MaskPosition
19
19
  attribute? :custom_emoji_id, Types::String
20
+ attribute? :needs_repainting, Types::True
20
21
  attribute? :file_size, Types::Integer
21
22
  end
22
23
  end
@@ -10,7 +10,7 @@ module Telegram
10
10
  attribute :is_animated, Types::Bool
11
11
  attribute :is_video, Types::Bool
12
12
  attribute :stickers, Types::Array.of(Sticker)
13
- attribute? :thumb, PhotoSize
13
+ attribute? :thumbnail, PhotoSize
14
14
  end
15
15
  end
16
16
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Story < Base; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class SwitchInlineQueryChosenChat < Base
7
+ attribute? :query, Types::String
8
+ attribute? :allow_user_chats, Types::Bool
9
+ attribute? :allow_bot_chats, Types::Bool
10
+ attribute? :allow_group_chats, Types::Bool
11
+ attribute? :allow_channel_chats, Types::Bool
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class TextQuote < Base
7
+ attribute :text, Types::String
8
+ attribute? :entities, Types::Array.of(MessageEntity)
9
+ attribute :position, Types::Integer
10
+ attribute? :is_manual, Types::True
11
+ end
12
+ end
13
+ end
14
+ end
@@ -9,6 +9,8 @@ module Telegram
9
9
  attribute? :edited_message, Message
10
10
  attribute? :channel_post, Message
11
11
  attribute? :edited_channel_post, Message
12
+ attribute? :message_reaction, MessageReactionUpdated
13
+ attribute? :message_reaction_count, MessageReactionCountUpdated
12
14
  attribute? :inline_query, InlineQuery
13
15
  attribute? :chosen_inline_result, ChosenInlineResult
14
16
  attribute? :callback_query, CallbackQuery
@@ -19,6 +21,8 @@ module Telegram
19
21
  attribute? :my_chat_member, ChatMemberUpdated
20
22
  attribute? :chat_member, ChatMemberUpdated
21
23
  attribute? :chat_join_request, ChatJoinRequest
24
+ attribute? :chat_boost, ChatBoostUpdated
25
+ attribute? :removed_chat_boost, ChatBoostRemoved
22
26
 
23
27
  def current_message
24
28
  @current_message ||=
@@ -10,8 +10,8 @@ module Telegram
10
10
  attribute? :last_name, Types::String
11
11
  attribute? :username, Types::String
12
12
  attribute? :language_code, Types::String
13
- attribute? :is_premium, Types::Bool
14
- attribute? :added_to_attachment_menu, Types::Bool
13
+ attribute? :is_premium, Types::True
14
+ attribute? :added_to_attachment_menu, Types::True
15
15
  attribute? :can_join_groups, Types::Bool
16
16
  attribute? :can_read_all_group_messages, Types::Bool
17
17
  attribute? :supports_inline_queries, Types::Bool
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class UserChatBoosts < Base
7
+ attribute :boosts, Types::Array.of(ChatBoost)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class UsersShared < Base
7
+ attribute :request_id, Types::Integer
8
+ attribute :user_ids, Types::Array.of(Types::Integer)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -9,7 +9,7 @@ module Telegram
9
9
  attribute :width, Types::Integer
10
10
  attribute :height, Types::Integer
11
11
  attribute :duration, Types::Integer
12
- attribute? :thumb, PhotoSize
12
+ attribute? :thumbnail, PhotoSize
13
13
  attribute? :file_name, Types::String
14
14
  attribute? :mime_type, Types::String
15
15
  attribute? :file_size, Types::Integer
@@ -8,7 +8,7 @@ module Telegram
8
8
  attribute :file_unique_id, Types::String
9
9
  attribute :length, Types::Integer
10
10
  attribute :duration, Types::Integer
11
- attribute? :thumb, PhotoSize
11
+ attribute? :thumbnail, PhotoSize
12
12
  attribute? :file_size, Types::Integer
13
13
  end
14
14
  end
@@ -12,7 +12,7 @@ module Telegram
12
12
  attribute? :last_error_message, Types::String
13
13
  attribute? :last_synchronization_error_date, Types::Integer
14
14
  attribute? :max_connections, Types::Integer
15
- attribute? :allowed_updates, Types::Array.of(String)
15
+ attribute? :allowed_updates, Types::Array.of(Types::String)
16
16
  end
17
17
  end
18
18
  end
@@ -4,6 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class WriteAccessAllowed < Base
7
+ attribute? :from_request, Types::Bool
8
+ attribute? :web_app_name, Types::String
9
+ attribute? :from_attachment_menu, Types::Bool
7
10
  end
8
11
  end
9
12
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Telegram
4
4
  module Bot
5
- VERSION = '1.0.0.rc1'
5
+ VERSION = '2.0.0'
6
6
  end
7
7
  end
data/lib/telegram/bot.rb CHANGED
@@ -25,5 +25,6 @@ end
25
25
 
26
26
  loader = Zeitwerk::Loader.new
27
27
  loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
28
+ loader.inflector.inflect('endpoints' => 'ENDPOINTS')
28
29
  loader.push_dir("#{__dir__}/bot", namespace: Telegram::Bot)
29
30
  loader.setup
@@ -1,9 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
-
6
- require 'telegram/bot/version'
3
+ require_relative 'lib/telegram/bot/version'
7
4
 
8
5
  Gem::Specification.new do |spec|
9
6
  spec.name = 'telegram-bot-ruby'
@@ -26,13 +23,4 @@ Gem::Specification.new do |spec|
26
23
  spec.add_dependency 'faraday', '~> 2.0'
27
24
  spec.add_dependency 'faraday-multipart', '~> 1.0'
28
25
  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
26
  end