teleruby 1.5.4 → 1.5.5

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +0 -2
  3. data/lib/api/delete_apis.rb +6 -6
  4. data/lib/api/get_apis.rb +22 -16
  5. data/lib/api/nstandard.rb +4 -1
  6. data/lib/api/other_apis.rb +19 -19
  7. data/lib/api/send_apis.rb +17 -17
  8. data/lib/api/set_apis.rb +14 -15
  9. data/lib/core_api.rb +3 -1
  10. data/lib/teleruby.rb +7 -2
  11. data/teleruby.gemspec +1 -1
  12. metadata +3 -53
  13. data/lib/api/all.rb +0 -12
  14. data/lib/objects/all.rb +0 -42
  15. data/lib/teleruby/all_apis.rb +0 -22
  16. data/lib/teleruby/api/delete_apis.rb +0 -58
  17. data/lib/teleruby/api/get_apis.rb +0 -172
  18. data/lib/teleruby/api/nstandard.rb +0 -27
  19. data/lib/teleruby/api/other_apis.rb +0 -241
  20. data/lib/teleruby/api/send_apis.rb +0 -206
  21. data/lib/teleruby/api/set_apis.rb +0 -137
  22. data/lib/teleruby/core_api.rb +0 -52
  23. data/lib/teleruby/objects/all.rb +0 -42
  24. data/lib/teleruby/objects/animation.rb +0 -40
  25. data/lib/teleruby/objects/audio.rb +0 -39
  26. data/lib/teleruby/objects/bot_command.rb +0 -24
  27. data/lib/teleruby/objects/callback_query.rb +0 -66
  28. data/lib/teleruby/objects/chat.rb +0 -164
  29. data/lib/teleruby/objects/chat_member.rb +0 -142
  30. data/lib/teleruby/objects/chat_permissions.rb +0 -59
  31. data/lib/teleruby/objects/chat_photo.rb +0 -37
  32. data/lib/teleruby/objects/chosen_inline_result.rb +0 -45
  33. data/lib/teleruby/objects/contact.rb +0 -37
  34. data/lib/teleruby/objects/dice.rb +0 -21
  35. data/lib/teleruby/objects/document.rb +0 -29
  36. data/lib/teleruby/objects/file.rb +0 -32
  37. data/lib/teleruby/objects/game.rb +0 -65
  38. data/lib/teleruby/objects/inline_query.rb +0 -44
  39. data/lib/teleruby/objects/inlinekeyboardbutton.rb +0 -59
  40. data/lib/teleruby/objects/inlinekeyboardmarkup.rb +0 -31
  41. data/lib/teleruby/objects/location.rb +0 -21
  42. data/lib/teleruby/objects/mask_position.rb +0 -35
  43. data/lib/teleruby/objects/message.rb +0 -400
  44. data/lib/teleruby/objects/message_entity.rb +0 -95
  45. data/lib/teleruby/objects/order_info.rb +0 -36
  46. data/lib/teleruby/objects/photo_size.rb +0 -14
  47. data/lib/teleruby/objects/poll.rb +0 -97
  48. data/lib/teleruby/objects/poll_answer.rb +0 -29
  49. data/lib/teleruby/objects/poll_option.rb +0 -22
  50. data/lib/teleruby/objects/pre_checkout_query.rb +0 -50
  51. data/lib/teleruby/objects/same/common.rb +0 -31
  52. data/lib/teleruby/objects/same/common_2.rb +0 -32
  53. data/lib/teleruby/objects/shipping_address.rb +0 -39
  54. data/lib/teleruby/objects/shipping_query.rb +0 -32
  55. data/lib/teleruby/objects/sticker.rb +0 -59
  56. data/lib/teleruby/objects/update.rb +0 -207
  57. data/lib/teleruby/objects/user.rb +0 -66
  58. data/lib/teleruby/objects/user_profile_photos.rb +0 -36
  59. data/lib/teleruby/objects/venue.rb +0 -40
  60. data/lib/teleruby/objects/video.rb +0 -39
  61. data/lib/teleruby/objects/video_note.rb +0 -50
  62. data/lib/teleruby/objects/voice.rb +0 -20
  63. data/lib/teleruby/version.rb +0 -3
@@ -1,32 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'user'
5
- require_relative 'shipping_address'
6
-
7
- # ===This object contains information about an incoming shipping query.
8
- class ShippingQuery
9
- def initialize(query) # :nodoc:
10
- @query = query
11
- end
12
-
13
- # Unique query identifier.
14
- def id
15
- @query.id
16
- end
17
-
18
- # User who sent the query.
19
- def from
20
- User.new(@query.from)
21
- end
22
-
23
- # Bot specified invoice payload.
24
- def invoice_payload
25
- @query.invoice_payload
26
- end
27
-
28
- # User specified shipping address.
29
- def shipping_address
30
- ShippingAddress.new(@query.shipping_address)
31
- end
32
- end
@@ -1,59 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'file'
5
- require_relative 'photo_size'
6
- require_relative 'mask_position'
7
-
8
- ##
9
- # This object represents a sticker.
10
- # Extends from TFile
11
- class Sticker < TFile
12
- def initialize(sticker) # :nodoc:
13
- super(sticker)
14
- end
15
-
16
- # Sticker width
17
- def width
18
- @file.width
19
- end
20
-
21
- # Sticker height
22
- def height
23
- @sticker.height
24
- end
25
-
26
- # True, if the sticker is animated
27
- def animated?
28
- @sticker.is_animated
29
- end
30
-
31
- # Optional. Sticker thumbnail in the .WEBP or .JPG format
32
- def thumb
33
- tmb = @sticker.thumb
34
- if tmb
35
- return PhotoSize.new(tmb)
36
- end
37
-
38
- false
39
- end
40
-
41
- # Optional. Emoji associated with the sticker
42
- def emoji
43
- @sticker.emoji
44
- end
45
-
46
- # Optional. Name of the sticker set to which the sticker belongs.
47
- def set_name
48
- @sticker.set_name
49
- end
50
-
51
- def mask_position
52
- msk_pos = @sticker.mask_position
53
- if msk_pos
54
- return MaskPosition.new(msk_pos)
55
- end
56
-
57
- false
58
- end
59
- end
@@ -1,207 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'message'
5
- require_relative 'poll'
6
- require_relative 'poll_answer'
7
- require_relative 'callback_query'
8
- require_relative 'chosen_inline_result'
9
- require_relative 'inline_query'
10
- require_relative 'pre_checkout_query'
11
- require_relative 'shipping_query'
12
-
13
- # ===This object represents an incoming update.
14
- class Update
15
- def initialize(update) # :nodoc:
16
- @update = update
17
- end
18
-
19
-
20
- # The update's unique identifier. Update identifiers start from a
21
- # certain positive number and increase sequentially. This ID becomes
22
- # especially handy if you're using Webhooks, since it allows you to
23
- # ignore repeated updates or to restore the correct update sequence,
24
- # should they get out of order. If there are no new updates for at
25
- # least a week, then identifier of the next update will be chosen
26
- # randomly instead of sequentially.
27
- def update_id
28
- @update.update_id
29
- end
30
-
31
- ##
32
- # New incoming message of any kind — text, photo, sticker, etc else
33
- # false is returned.
34
- # returns Message object
35
- def message
36
- msg = @update.message
37
- unless msg.nil?
38
- return Message.new(msg)
39
- end
40
-
41
- false
42
- end
43
-
44
- ##
45
- # New version of a message that is known to the bot and was edited else
46
- # false is returned.
47
- def edited_message
48
- e_msg = @update.edited_message
49
- unless e_msg.nil?
50
- return Message.new(e_msg)
51
- end
52
-
53
- false
54
- end
55
-
56
- ##
57
- # New incoming channel post of any kind — text, photo, sticker, etc else
58
- # false is returned.
59
- def channel_post
60
- c_post = @update.channel_post
61
- unless c_post.nil?
62
- return Message.new(c_post)
63
- end
64
-
65
- false
66
- end
67
-
68
- ##
69
- # New version of a channel post that is known to the bot and was edited.
70
- # else false is returned.
71
- def edited_channel_post
72
- e_c_post = @update.edited_channel_post
73
- unless e_c_post.nil?
74
- return Message.new(e_c_post)
75
- end
76
-
77
- false
78
- end
79
-
80
- ##
81
- # +Optional.+ New incoming inline query.
82
- def inline_query
83
- i_query = @update.inline_query
84
- unless i_query.nil?
85
- return InlineQuery.new(i_query)
86
- end
87
-
88
- false
89
- end
90
-
91
- ##
92
- # +Optional.+ The result of an inline query that was chosen by a user
93
- # and sent to their chat partner. Please see our documentation on the
94
- # feedback collecting for details on how to enable these updates for
95
- # your bot.
96
- def chosen_inline_result
97
- inline_result = @update.chosen_inline_result
98
- unless inline_result
99
- return ChoseInlineResult.new(inline_result)
100
- end
101
-
102
- false
103
- end
104
-
105
- ##
106
- # +Optional+. New incoming callback query. Returns CallBackQuery object
107
- def callback_query
108
- qury = @update.callback_query
109
- unless qury.nil?
110
- return CallBackQuery.new(qury)
111
- end
112
-
113
- false
114
- end
115
-
116
- ##
117
- # +Optional.+ New incoming shipping query. Only for invoices with
118
- # flexible price
119
- def shipping_query
120
- s_query = @udpate.shipping_query
121
- unless s_query.nil?
122
- return ShippingQuery.new(s_query)
123
- end
124
-
125
- false
126
- end
127
-
128
- ##
129
- # +Optional+. New incoming pre-checkout query. Contains full
130
- # information about checkout
131
- def pre_checkout_query
132
- p_c_query = @update.pre_checkout_query
133
- unless p_C_query.nil?
134
- return PreCheckoutQuery.new(p_c_query)
135
- end
136
-
137
- false
138
- end
139
-
140
- ##
141
- # +Optional+. New poll state. Bots receive only updates about stopped
142
- # polls and polls, which are sent by the bot.
143
- def poll
144
- pol = @udpate.poll
145
- unless pol.nil?
146
- return Poll.new(pol)
147
- end
148
-
149
- false
150
- end
151
-
152
- ##
153
- # New poll state. Bots receive only updates about stopped polls and
154
- # polls, which are sent by the bot.
155
- def poll_answer
156
- p_answer = @update.poll_answer
157
- unless p_answer.nil?
158
- return PollAnswer.new(p_answer)
159
- end
160
-
161
- false
162
- end
163
-
164
- def msg?
165
- @update.message ? true : false
166
- end
167
-
168
- def channel_post?
169
- @update.channel_post ? true : false
170
- end
171
-
172
- def edited_msg?
173
- @update.edited_message ? true : false
174
- end
175
-
176
- def edited_channel_post?
177
- @update.edited_channel_post ? true : false
178
- end
179
-
180
- def inline_query?
181
- @update.inline_query ? true : false
182
- end
183
-
184
- def new_state_poll?
185
- @update.poll ? true : false
186
- end
187
-
188
- def chosen_inline_result?
189
- @update.chosen_inline_result ? true : false
190
- end
191
-
192
- def callback_query?
193
- @update.callback_query ? true : false
194
- end
195
-
196
- def shipping_query?
197
- @update.shipping_query ? true : false
198
- end
199
-
200
- def pre_checkout_query?
201
- @update.pre_checkout_query ? true : false
202
- end
203
-
204
- def poll_answer?
205
- @update.poll_answer ? true : false
206
- end
207
- end
@@ -1,66 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- ##
5
- # +Monday+, +August+ +24+ +2020+ +EAT+
6
- # ===This object represents a Telegram user.
7
- class User
8
- def initialize(user) # :nodoc:
9
- @user = user
10
- end
11
-
12
- # Unique identifier for this user or bot.
13
- def id
14
- @user.id
15
- end
16
-
17
- # True, if this user is a bot.
18
- def bot?
19
- @user.is_bot
20
- end
21
-
22
- # User's or bot's first name.
23
- def first_name
24
- @user.first_name
25
- end
26
-
27
- # +Optional.+ User 's or BotUser 's last name.
28
- def last_name
29
- @user.last_name
30
- end
31
-
32
- # +Optional+. User's or bot's username
33
- def username
34
- @user.username
35
- end
36
-
37
- # +Optional+.
38
- # {IETF language}[https://en.wikipedia.org/wiki/IETF_language_tag]
39
- # tag of the user's language.
40
- def language_code
41
- @user.language_code
42
- end
43
- end
44
-
45
- # ===Class returned only in get_me method.
46
- # This class extends from User class.
47
- class BotUser < User
48
- def initialize(bot) # :nodoc:
49
- super(bot)
50
- end
51
-
52
- # +Optional.+ True, if the bot can be invited to groups.
53
- def can_join_groups
54
- @user.can_join_groups
55
- end
56
-
57
- # +Optional.+ True, if privacy mode is disabled for the bot.
58
- def can_read_all_group_messages?
59
- @user.can_read_all_group_messages
60
- end
61
-
62
- # +Optional.+ True, if the bot supports inline queries.
63
- def supports_inline_queries?
64
- @user.supports_inline_queries
65
- end
66
- end
@@ -1,36 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'photo_size'
5
-
6
- ##
7
- # +Monday+, +August+ +24+ +2020+
8
- # ==This object represent a user's profile pictures.
9
- class UserProfilePhotos
10
- def initialize(photo) # :nodoc:
11
- @photo = photo
12
- end
13
-
14
- #
15
- # Total number of profile pictures the target user has.
16
- def total_count
17
- @photo.total_count
18
- end
19
-
20
- ##
21
- # Requested profile pictures (in up to 4 sizes each).
22
- # Returns array of array of PhotoSize.
23
- def photos
24
- data = @photo.photos
25
- photo_size = []
26
- data.each do |e|
27
- ary = []
28
- e.each do |e_d|
29
- ary << PhotoSize.new(e_d)
30
- end
31
- photo_size << ary
32
- end
33
-
34
- photo_size
35
- end
36
- end
@@ -1,40 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'location'
5
-
6
- ##
7
- # +Monday+, +August+ +24+ +2020+ +EAT+
8
- # ====This object represents a venue.
9
- class Venue
10
- def initialize(vn) # :nodoc:
11
- @vn = vn
12
- end
13
-
14
- # Venue location. Returns Location Object.
15
- def location
16
- @vn.location
17
- end
18
-
19
- # Name of the venue.
20
- def title
21
- @vn.title
22
- end
23
-
24
- # Address of the venue.
25
- def address
26
- @vn.address
27
- end
28
-
29
- # +Optional+. Foursquare identifier of the venue
30
- def foursquare_id
31
- @vn.foursquare_id
32
- end
33
-
34
- # Optional. Foursquare type of the venue.
35
- # (For example, +“arts_entertainment/default”+,
36
- # +“arts_entertainment/aquarium”+ or +“food/icecream”.+)
37
- def foursquare_type
38
- @vn.foursquare_type
39
- end
40
- end
@@ -1,39 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'same/common_2'
5
- require_relative 'photo_size'
6
-
7
- ##
8
- # ===This object represents a video file.
9
- # Extends Common2 class.
10
- class Video < Common2
11
- def initialize(obj) # :nodoc:
12
- super(obj)
13
- end
14
-
15
- # Video width as defined by sender.
16
- def width
17
- @obj.width
18
- end
19
-
20
- # Video height as defined by sender.
21
- def heigth
22
- @obj.heigth
23
- end
24
-
25
- # Duration of the video in seconds as defined by sender.
26
- def duration
27
- @obj.duration
28
- end
29
-
30
- # +Optional+. Video thumbnail.
31
- def thumb
32
- data = @obj.thumb
33
- unless data
34
- return PhotoSize.new(data)
35
- end
36
-
37
- false
38
- end
39
- end