telegram-bot-types 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -1
- data/.travis.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/bin/install_git_hooks +2 -1
- data/lib/telegram/bot/types.rb +10 -72
- data/lib/telegram/bot/types/animation.rb +6 -0
- data/lib/telegram/bot/types/audio.rb +4 -0
- data/lib/telegram/bot/types/base.rb +2 -0
- data/lib/telegram/bot/types/callback_game.rb +2 -0
- data/lib/telegram/bot/types/callback_query.rb +2 -0
- data/lib/telegram/bot/types/chat.rb +6 -0
- data/lib/telegram/bot/types/chat_member.rb +8 -3
- data/lib/telegram/bot/types/chat_permissions.rb +18 -0
- data/lib/telegram/bot/types/chat_photo.rb +4 -0
- data/lib/telegram/bot/types/chosen_inline_result.rb +2 -0
- data/lib/telegram/bot/types/contact.rb +3 -0
- data/lib/telegram/bot/types/document.rb +3 -0
- data/lib/telegram/bot/types/encrypted_credentials.rb +13 -0
- data/lib/telegram/bot/types/encrypted_passport_element.rb +20 -0
- data/lib/telegram/bot/types/file.rb +3 -0
- data/lib/telegram/bot/types/force_reply.rb +2 -0
- data/lib/telegram/bot/types/game.rb +2 -0
- data/lib/telegram/bot/types/game_high_score.rb +2 -0
- data/lib/telegram/bot/types/inline_keyboard_button.rb +3 -0
- data/lib/telegram/bot/types/inline_keyboard_markup.rb +2 -0
- data/lib/telegram/bot/types/inline_query.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_article.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_audio.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_document.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_video.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_contact.rb +3 -0
- data/lib/telegram/bot/types/inline_query_result_document.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_game.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_location.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_photo.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_venue.rb +3 -0
- data/lib/telegram/bot/types/inline_query_result_video.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result_voice.rb +2 -0
- data/lib/telegram/bot/types/input_contact_message_content.rb +3 -0
- data/lib/telegram/bot/types/input_location_message_content.rb +2 -0
- data/lib/telegram/bot/types/input_media_animation.rb +18 -0
- data/lib/telegram/bot/types/input_media_audio.rb +18 -0
- data/lib/telegram/bot/types/input_media_document.rb +15 -0
- data/lib/telegram/bot/types/input_media_photo.rb +13 -0
- data/lib/telegram/bot/types/input_media_video.rb +17 -0
- data/lib/telegram/bot/types/input_message_content.rb +2 -0
- data/lib/telegram/bot/types/input_text_message_content.rb +2 -0
- data/lib/telegram/bot/types/input_venue_message_content.rb +3 -0
- data/lib/telegram/bot/types/invoice.rb +2 -0
- data/lib/telegram/bot/types/keyboard_button.rb +3 -0
- data/lib/telegram/bot/types/keyboard_button_poll_type.rb +11 -0
- data/lib/telegram/bot/types/labeled_price.rb +2 -0
- data/lib/telegram/bot/types/location.rb +2 -0
- data/lib/telegram/bot/types/login_url.rb +14 -0
- data/lib/telegram/bot/types/mask_position.rb +2 -0
- data/lib/telegram/bot/types/message.rb +10 -0
- data/lib/telegram/bot/types/message_entity.rb +3 -0
- data/lib/telegram/bot/types/order_info.rb +2 -0
- data/lib/telegram/bot/types/passport_data.rb +12 -0
- data/lib/telegram/bot/types/passport_element_error_data_field.rb +15 -0
- data/lib/telegram/bot/types/passport_element_error_file.rb +14 -0
- data/lib/telegram/bot/types/passport_element_error_files.rb +14 -0
- data/lib/telegram/bot/types/passport_element_error_front_side.rb +14 -0
- data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +14 -0
- data/lib/telegram/bot/types/passport_element_error_selfie.rb +14 -0
- data/lib/telegram/bot/types/passport_element_error_translation_file.rb +14 -0
- data/lib/telegram/bot/types/passport_element_error_translation_files.rb +14 -0
- data/lib/telegram/bot/types/passport_element_error_unspecified.rb +14 -0
- data/lib/telegram/bot/types/passport_file.rb +14 -0
- data/lib/telegram/bot/types/photo_size.rb +3 -0
- data/lib/telegram/bot/types/poll.rb +19 -0
- data/lib/telegram/bot/types/poll_answer.rb +13 -0
- data/lib/telegram/bot/types/poll_option.rb +12 -0
- data/lib/telegram/bot/types/pre_checkout_query.rb +2 -0
- data/lib/telegram/bot/types/reply_keyboard_markup.rb +2 -0
- data/lib/telegram/bot/types/reply_keyboard_remove.rb +2 -0
- data/lib/telegram/bot/types/response.rb +2 -0
- data/lib/telegram/bot/types/shipping_address.rb +2 -0
- data/lib/telegram/bot/types/shipping_option.rb +2 -0
- data/lib/telegram/bot/types/shipping_query.rb +2 -0
- data/lib/telegram/bot/types/sticker.rb +4 -0
- data/lib/telegram/bot/types/sticker_set.rb +3 -0
- data/lib/telegram/bot/types/successful_payment.rb +2 -0
- data/lib/telegram/bot/types/update.rb +4 -0
- data/lib/telegram/bot/types/user.rb +5 -0
- data/lib/telegram/bot/types/user_profile_photos.rb +2 -0
- data/lib/telegram/bot/types/venue.rb +3 -0
- data/lib/telegram/bot/types/version.rb +3 -1
- data/lib/telegram/bot/types/video.rb +3 -0
- data/lib/telegram/bot/types/video_note.rb +3 -0
- data/lib/telegram/bot/types/voice.rb +3 -0
- data/lib/telegram/bot/types/webhook_info.rb +4 -2
- data/telegram-bot-types.gemspec +5 -3
- metadata +31 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1771ee234053a034be028b35b8e5fe86d3af10aacb907b38072434ee32023406
|
4
|
+
data.tar.gz: a56fed6b23ad7fccd5902b7eb73d76c5c642ac41f6208636ba0d3d0803a8f58d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b38f2f3c699701ddea60d34e764a8aa797e71feb129212c55bb90a3b23897feb50ab133a9704e00fdacc88e24536114118b140c8230b0789dfc191f67983f219
|
7
|
+
data.tar.gz: a3a5d8aa19b949082bd0d7e33f2d3b298fe316491c0127f968999d45d59d8d8df696ddd7a99fbb4d6459801b31ec529bf86dd09bfa71b6234ff67a563a172fca
|
data/.rubocop.yml
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
+
Layout/EmptyLineAfterGuardClause: {Enabled: false}
|
2
|
+
Layout/SpaceInsideHashLiteralBraces: {EnforcedStyle: no_space}
|
1
3
|
Metrics/LineLength: {Max: 100}
|
2
4
|
Style/Alias: {EnforcedStyle: prefer_alias_method}
|
3
5
|
Style/Documentation: {Enabled: false}
|
4
|
-
Style/
|
6
|
+
Style/TrailingCommaInArrayLiteral: {EnforcedStyleForMultiline: comma}
|
7
|
+
Style/TrailingCommaInHashLiteral: {EnforcedStyleForMultiline: comma}
|
8
|
+
|
9
|
+
# New cops. Need to be explicitly enabled to prevent warning.
|
10
|
+
Lint/RaiseException: {Enabled: true}
|
11
|
+
Lint/StructNewOverride: {Enabled: true}
|
12
|
+
Style/HashEachMethods: {Enabled: true}
|
13
|
+
Style/HashTransformKeys: {Enabled: true}
|
14
|
+
Style/HashTransformValues: {Enabled: true}
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/bin/install_git_hooks
CHANGED
data/lib/telegram/bot/types.rb
CHANGED
@@ -1,85 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
|
1
5
|
module Telegram
|
2
6
|
module Bot
|
3
7
|
module Types
|
4
8
|
module_function
|
5
9
|
|
6
10
|
# Simple implementation for internal use only.
|
11
|
+
# rubocop:disable all
|
7
12
|
def camelize(str)
|
8
13
|
str.gsub(/(?:_|(\/)|^)([a-z\d]*)/i) { "#{$1}#{$2.capitalize}" }
|
9
14
|
end
|
15
|
+
# rubocop:enable all
|
10
16
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
callback_game
|
16
|
-
callback_query
|
17
|
-
chat
|
18
|
-
chat_member
|
19
|
-
chat_photo
|
20
|
-
chosen_inline_result
|
21
|
-
contact
|
22
|
-
document
|
23
|
-
file
|
24
|
-
force_reply
|
25
|
-
game
|
26
|
-
game_high_score
|
27
|
-
inline_keyboard_button
|
28
|
-
inline_keyboard_markup
|
29
|
-
inline_query
|
30
|
-
inline_query_result_article
|
31
|
-
inline_query_result_audio
|
32
|
-
inline_query_result_cached_audio
|
33
|
-
inline_query_result_cached_document
|
34
|
-
inline_query_result_cached_gif
|
35
|
-
inline_query_result_cached_mpeg4_gif
|
36
|
-
inline_query_result_cached_photo
|
37
|
-
inline_query_result_cached_sticker
|
38
|
-
inline_query_result_cached_video
|
39
|
-
inline_query_result_cached_voice
|
40
|
-
inline_query_result_contact
|
41
|
-
inline_query_result_document
|
42
|
-
inline_query_result_game
|
43
|
-
inline_query_result_gif
|
44
|
-
inline_query_result_location
|
45
|
-
inline_query_result_mpeg4_gif
|
46
|
-
inline_query_result_photo
|
47
|
-
inline_query_result_venue
|
48
|
-
inline_query_result_video
|
49
|
-
inline_query_result_voice
|
50
|
-
input_contact_message_content
|
51
|
-
input_location_message_content
|
52
|
-
input_message_content
|
53
|
-
input_text_message_content
|
54
|
-
input_venue_message_content
|
55
|
-
invoice
|
56
|
-
keyboard_button
|
57
|
-
labeled_price
|
58
|
-
location
|
59
|
-
mask_position
|
60
|
-
message
|
61
|
-
message_entity
|
62
|
-
order_info
|
63
|
-
photo_size
|
64
|
-
pre_checkout_query
|
65
|
-
reply_keyboard_markup
|
66
|
-
reply_keyboard_remove
|
67
|
-
response
|
68
|
-
shipping_address
|
69
|
-
shipping_option
|
70
|
-
shipping_query
|
71
|
-
sticker
|
72
|
-
sticker_set
|
73
|
-
successful_payment
|
74
|
-
update
|
75
|
-
user
|
76
|
-
user_profile_photos
|
77
|
-
venue
|
78
|
-
video
|
79
|
-
video_note
|
80
|
-
voice
|
81
|
-
webhook_info
|
82
|
-
].each do |type|
|
17
|
+
files = Pathname(__FILE__).dirname.join('types').children.map { |x| x.basename.to_s }
|
18
|
+
types = files.select { |x| x.end_with?('.rb') }.map { |x| x.gsub(/\.rb$/, '') }
|
19
|
+
types -= ['version']
|
20
|
+
types.each do |type|
|
83
21
|
autoload camelize(type), "telegram/bot/types/#{type}"
|
84
22
|
end
|
85
23
|
end
|
@@ -1,8 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
4
6
|
class Animation < Base
|
5
7
|
attribute :file_id, String
|
8
|
+
attribute :file_unique_id, String
|
9
|
+
attribute :width, Integer
|
10
|
+
attribute :height, Integer
|
11
|
+
attribute :duration, Integer
|
6
12
|
attribute :thumb, PhotoSize
|
7
13
|
attribute :file_name, String
|
8
14
|
attribute :mime_type, String
|
@@ -1,13 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
4
6
|
class Audio < Base
|
5
7
|
attribute :file_id, String
|
8
|
+
attribute :file_unique_id, String
|
6
9
|
attribute :duration, Integer
|
7
10
|
attribute :performer, String
|
8
11
|
attribute :title, String
|
9
12
|
attribute :mime_type, String
|
10
13
|
attribute :file_size, Integer
|
14
|
+
attribute :thumb, PhotoSize
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
@@ -13,6 +15,10 @@ module Telegram
|
|
13
15
|
attribute :description, String
|
14
16
|
attribute :invite_link, String
|
15
17
|
attribute :pinned_message, Message
|
18
|
+
attribute :permissions, ChatPermissions
|
19
|
+
attribute :slow_mode_delay, Integer
|
20
|
+
attribute :sticker_set_name, String
|
21
|
+
attribute :can_set_sticker_set, Boolean
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
@@ -1,21 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
4
6
|
class ChatMember < Base
|
5
7
|
attribute :user, User
|
6
8
|
attribute :status, String
|
9
|
+
attribute :custom_title, String
|
7
10
|
attribute :until_date, Integer
|
8
11
|
attribute :can_be_edited, Boolean
|
9
|
-
attribute :can_change_info, Boolean
|
10
12
|
attribute :can_post_messages, Boolean
|
11
13
|
attribute :can_edit_messages, Boolean
|
12
14
|
attribute :can_delete_messages, Boolean
|
13
|
-
attribute :can_invite_users, Boolean
|
14
15
|
attribute :can_restrict_members, Boolean
|
15
|
-
attribute :can_pin_messages, Boolean
|
16
16
|
attribute :can_promote_members, Boolean
|
17
|
+
attribute :can_change_info, Boolean
|
18
|
+
attribute :can_invite_users, Boolean
|
19
|
+
attribute :can_pin_messages, Boolean
|
20
|
+
attribute :is_member, Boolean
|
17
21
|
attribute :can_send_messages, Boolean
|
18
22
|
attribute :can_send_media_messages, Boolean
|
23
|
+
attribute :can_send_polls, Boolean
|
19
24
|
attribute :can_send_other_messages, Boolean
|
20
25
|
attribute :can_add_web_page_previews, Boolean
|
21
26
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class ChatPermissions < Base
|
7
|
+
attribute :can_send_messages, Boolean
|
8
|
+
attribute :can_send_media_messages, Boolean
|
9
|
+
attribute :can_send_polls, Boolean
|
10
|
+
attribute :can_send_other_messages, Boolean
|
11
|
+
attribute :can_add_web_page_previews, Boolean
|
12
|
+
attribute :can_change_info, Boolean
|
13
|
+
attribute :can_invite_users, Boolean
|
14
|
+
attribute :can_pin_messages, Boolean
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,9 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
4
6
|
class ChatPhoto < Base
|
5
7
|
attribute :small_file_id, String
|
8
|
+
attribute :small_file_unique_id, String
|
6
9
|
attribute :big_file_id, String
|
10
|
+
attribute :big_file_unique_id, String
|
7
11
|
end
|
8
12
|
end
|
9
13
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
4
6
|
class Document < Base
|
5
7
|
attribute :file_id, String
|
8
|
+
attribute :file_unique_id, String
|
6
9
|
attribute :thumb, PhotoSize
|
7
10
|
attribute :file_name, String
|
8
11
|
attribute :mime_type, String
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class EncryptedPassportElement < Base
|
7
|
+
attribute :type, String
|
8
|
+
attribute :data, String
|
9
|
+
attribute :phone_number, String
|
10
|
+
attribute :email, String
|
11
|
+
attribute :files, [PassportFile]
|
12
|
+
attribute :front_side, PassportFile
|
13
|
+
attribute :reverse_side, PassportFile
|
14
|
+
attribute :selfie, PassportFile
|
15
|
+
attribute :translation, [PassportFile]
|
16
|
+
attribute :hash, String
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,9 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Telegram
|
2
4
|
module Bot
|
3
5
|
module Types
|
4
6
|
class InlineKeyboardButton < Base
|
5
7
|
attribute :text, String
|
6
8
|
attribute :url, String
|
9
|
+
attribute :login_url, LoginUrl
|
7
10
|
attribute :callback_data, String
|
8
11
|
attribute :switch_inline_query, String
|
9
12
|
attribute :switch_inline_query_current_chat, String
|