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,95 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'user'
5
-
6
- ##
7
- # +Monday+, +August+ +24+ +2020+ +EAT+
8
- # ===This object represents one special entity in a text message.
9
- # For example, +hashtags,+ +usernames+, +URLs,+ etc.
10
- class MessageEntity
11
- def initialize(msg) # :nodoc:
12
- @msg = msg
13
- freeze
14
- end
15
-
16
- # Type of the entity. Can be +mention+( @username ), +hashtag+( #hashtag ),
17
- # +cashtag+( $USD ), +bot_command+( /start@jobs_bot ),
18
- # +url+( https://telegram.org ), +email+( do-not-reply@telegram.org ),
19
- # +phone_number+( +1-212-555-0123 ), +bold+(bold text),
20
- # *italic*(italic text), +underline+(underlined text),
21
- # +strikethrough+(strikethrough text), +code+
22
- # (monowidth string), +pre+ (monowidth block),
23
- # +text_link+(for clickable text URLs),
24
- # +text_mention+ (for users without usernames)
25
- def type
26
- @msg.type
27
- end
28
-
29
- # Offset in UTF-16 code units to the start of the entity.
30
- def offset
31
- @msg.offset
32
- end
33
-
34
- # Length of the entity in UTF-16 code units.
35
- def length
36
- @msg.length
37
- end
38
-
39
- # +Optional.+ For +text_link+ only, url that will be opened after user
40
- # taps on the text.
41
- def url
42
- @msg.url
43
- end
44
-
45
- # +Optional.+ For +pre+ only, the programming language of the entity text.
46
- def language
47
- @msg.language
48
- end
49
-
50
- # +Optional+. For text_mention? only, the mentioned user.
51
- # Returns User object
52
- def user
53
- usr = @msg.user
54
- unless user.nil?
55
- return User.new(usr)
56
- end
57
-
58
- false
59
- end
60
-
61
- # Returns true if entity #type is mention else false is returned.
62
- def mention?
63
- type.eql? 'mention'
64
- end
65
-
66
- # Returns true if entity #type is bot_command else false is returned.
67
- def bot_command?
68
- type.eql? 'bot_command'
69
- end
70
-
71
- # Return true if entity #type is url else false is returned.
72
- def link?
73
- type.elq? 'url'
74
- end
75
-
76
- # Returns true if entity #type is email else false is returned.
77
- def email?
78
- type.eql? 'email'
79
- end
80
-
81
- # Return true if entity #type is +phone_number+ else false is returned.
82
- def phone_number?
83
- type.eql? 'phone_number'
84
- end
85
-
86
- # Returns true if entity #type is +text_link+ else false is returned.
87
- def text_link?
88
- type.eql? 'text_link'
89
- end
90
-
91
- # Returns true if entity #type is +text_mention+ else false is returned.
92
- def text_mention?
93
- type.eql? 'text_mention'
94
- end
95
- end
@@ -1,36 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'shipping_address'
5
-
6
- # This object represents information about an order.
7
- class OrderInfo
8
- def initialize(info) # :nodoc:
9
- @info = info
10
- end
11
-
12
- # Optional. User name
13
- def name
14
- @info.name
15
- end
16
-
17
- # Optional. User's phone number.
18
- def phone_number
19
- @info.phone_number
20
- end
21
-
22
- # Optional. User email
23
- def email
24
- @info.email
25
- end
26
-
27
- # Optional. User shipping address
28
- def shipping_address
29
- address = @info.shipping_address
30
- unless address.nil?
31
- return ShippingAddress.new(address)
32
- end
33
-
34
- false
35
- end
36
- end
@@ -1,14 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'same/common'
5
-
6
- ##
7
- # +Monday,+ +August+ +24+ +2020+
8
- # ===This object represents one size of a photo or a file/sticker thumbnail.
9
- # Extends Common class.
10
- class PhotoSize < Common
11
- def initialize(photo) # :nodoc:
12
- super(photo)
13
- end
14
- end
@@ -1,97 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'poll_option'
5
- require_relative 'message_entity'
6
-
7
- # ===This object contains information about a poll.
8
- class Poll
9
- def initialize(poll) # :nodoc:
10
- @poll = poll
11
- freeze
12
- end
13
-
14
- # Unique poll identifier.
15
- def id
16
- @poll.id
17
- end
18
-
19
- # Poll question, 1-255 characters.
20
- def question
21
- @poll.question
22
- end
23
-
24
- # Returns array of PollOption s. else false is returned.
25
- def options
26
- opt = @poll.options
27
- unless opt.nil?
28
- poll_options = []
29
- opt.each do |o|
30
- poll_options << PollOption.new(o)
31
- end
32
- return poll_options
33
- end
34
-
35
- false
36
- end
37
-
38
- # Total number of users that voted in the poll.
39
- def total_voter_count
40
- @poll.total_voter_count
41
- end
42
-
43
- # True, if the poll is closed.
44
- def closed?
45
- @poll.is_closed
46
- end
47
-
48
- # True, if the poll is anonymous.
49
- def anonymous?
50
- @poll.is_anonymous
51
- end
52
-
53
- # Poll type, currently can be "regular" or "quiz"
54
- def type
55
- @poll.type
56
- end
57
-
58
- # +Optional+. 0-based identifier of the correct answer option.
59
- # Available only for polls in the quiz mode, which are closed, or was
60
- # sent (not forwarded) by the bot or to the private chat with the bot.
61
- def correct_option_id
62
- @poll.correct_option_id
63
- end
64
-
65
- # +Optional.+ Text that is shown when a user chooses an incorrect answer
66
- # or taps on the lamp icon in a quiz-style poll, 0-200 characters.
67
- def explanation
68
- @poll.explanation
69
- end
70
-
71
- # +Optional.+ Special entities like *usernames*, *URLs*, bot commands,
72
- # etc. that appear in the explanation.
73
- def explanation_entities
74
- data = @poll.explanation_entities
75
- unless data.nil?
76
- explanations = []
77
- data.each do |exp|
78
- explanations << MessageEntity.new(exp)
79
- end
80
- return explanations
81
- end
82
-
83
- false
84
- end
85
-
86
- # +Optional.+ Amount of time in seconds the poll will be active after
87
- # creation.
88
- def open_period
89
- @poll.open_period
90
- end
91
-
92
- # +Optional.+ Point in time (Unix timestamp) when the poll will be
93
- # automatically closed.
94
- def close_date
95
- @poll.close_date
96
- end
97
- end
@@ -1,29 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'user'
5
-
6
- # +Sunday,+ +August+ +23+ +2020+
7
-
8
- # ===This object represents an answer of a user in a non-anonymous poll.
9
- class PollAnswer
10
- def initialize(poll) # :nodoc:
11
- @poll = poll
12
- end
13
-
14
- # Unique poll identifier.
15
- def poll_id
16
- @poll.poll_id
17
- end
18
-
19
- # The user, who changed the answer to the poll. Return User object
20
- def user
21
- User.new(@poll.user)
22
- end
23
-
24
- # 0-based identifiers of answer options, chosen by the user.
25
- # May be empty if the user retracted their vote.
26
- def option_ids
27
- @poll.option_ids
28
- end
29
- end
@@ -1,22 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- ##
5
- # +Monday,+ +August+ +24+ 2020+ +EAT+
6
- # ===This object contains information about one answer option in a poll.
7
- class PollOption
8
- def initialize(poll) # :nodoc:
9
- @poll = poll
10
- freeze
11
- end
12
-
13
- # +Option+ text, 1-100 characters.
14
- def text
15
- @poll.text
16
- end
17
-
18
- # Number of users that voted for this option.
19
- def voter_count
20
- @poll.voter_count
21
- end
22
- end
@@ -1,50 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative 'user'
5
- require_relative 'order_info'
6
-
7
- # This object contains information about an incoming pre-checkout query.
8
- class PreCheckoutQuery
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
- # Three-letter ISO 4217 currency code
24
- def currency
25
- @query.currency
26
- end
27
-
28
- # Total price in the smallest units of the currency
29
- # (integer, not float/double). For example, for a price of US$ 1.45
30
- # pass amount = 145 . See the exp parameter in currencies.json,
31
- # it shows the number of digits past the decimal point for each
32
- # currency (2 for the majority of currencies).
33
- def total_count
34
- @query.total_count
35
- end
36
-
37
- # Bot specified invoice payload.
38
- def invoice_option_id
39
- @query.invoice_option_id
40
- end
41
-
42
- def order_info
43
- info = @query.order_info
44
- unless info.nil?
45
- return OrderInfo.new(info)
46
- end
47
-
48
- false
49
- end
50
- end
@@ -1,31 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- ##
5
- # +Monday+, +August+ +24+ +2020+ +EAT+
6
- # ===Common class
7
- class Common
8
- def initialize(obj) # :nodoc:
9
- @obj = obj
10
- end
11
-
12
- def file_id
13
- @obj['file_id']
14
- end
15
-
16
- def file_unique_id
17
- @obj['file_unique_id']
18
- end
19
-
20
- def width
21
- @obj['width']
22
- end
23
-
24
- def heigth
25
- @obj['heigth']
26
- end
27
-
28
- def file_size
29
- @obj['file_size']
30
- end
31
- end
@@ -1,32 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- ##
5
- # +Monday,+ +August+ +24+ +2020+
6
- # ===common class for Audio, Video, and Document and Voice
7
- class Common2
8
- def initialize(obj) # :nodoc:
9
- @obj = obj
10
- freeze
11
- end
12
-
13
- # File id for the object
14
- def file_id
15
- @obj['file_id']
16
- end
17
-
18
- # File unique id for the object.
19
- def file_unique_id
20
- @obj['file_unique_id']
21
- end
22
-
23
- # +Optional+. MIME type of the file as defined by sender.
24
- def mime_type
25
- @obj['mime_type']
26
- end
27
-
28
- # +Optional.+ File size
29
- def file_size
30
- @obj['file_size']
31
- end
32
- end
@@ -1,39 +0,0 @@
1
- #!/usr/bin/ruby
2
- # frozen_string_literal: true
3
-
4
- # ===This object represents a shipping address
5
- class ShippingAddress
6
- def initialize(shipping) # :nodoc:
7
- @shipping = shipping
8
- end
9
-
10
- # ISO 3166-1 alpha-2 country code.
11
- def country_code
12
- @shipping.country_code
13
- end
14
-
15
- # State, if applicable.
16
- def state
17
- @shipping.state
18
- end
19
-
20
- # City
21
- def city
22
- @shipping.city
23
- end
24
-
25
- # First line for the address.
26
- def street_line1
27
- @shipping.street_lin2
28
- end
29
-
30
- # Second line for the address
31
- def street_line2
32
- @shipping.street_line2
33
- end
34
-
35
- # Address post code
36
- def post_code
37
- @shipping.post_code
38
- end
39
- end