telegram-bot-ruby 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -0
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/lib/telegram/bot/api.rb +7 -6
- data/lib/telegram/bot/client.rb +1 -1
- data/lib/telegram/bot/types.rb +9 -0
- data/lib/telegram/bot/types/inline_keyboard_button.rb +1 -0
- data/lib/telegram/bot/types/inline_query_result_gif.rb +1 -0
- data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +1 -0
- data/lib/telegram/bot/types/invoice.rb +13 -0
- data/lib/telegram/bot/types/labeled_price.rb +10 -0
- data/lib/telegram/bot/types/message.rb +4 -1
- data/lib/telegram/bot/types/order_info.rb +12 -0
- data/lib/telegram/bot/types/pre_checkout_query.rb +15 -0
- data/lib/telegram/bot/types/shipping_address.rb +14 -0
- data/lib/telegram/bot/types/shipping_option.rb +11 -0
- data/lib/telegram/bot/types/shipping_query.rb +12 -0
- data/lib/telegram/bot/types/successful_payment.rb +15 -0
- data/lib/telegram/bot/types/update.rb +2 -0
- data/lib/telegram/bot/types/user.rb +1 -0
- data/lib/telegram/bot/types/video_note.rb +13 -0
- data/lib/telegram/bot/version.rb +1 -1
- data/telegram-bot-ruby.gemspec +1 -1
- metadata +14 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 480b4e15b9e410b8d8023d7af355e8f9cbcb5fe5
|
4
|
+
data.tar.gz: 83501301ed0d36db7c9d40c9450913b5fd0d1e34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c93d0d104cb261d85aa74d39e83b9c7a9860005fa4974d096459df83d504e09f9632a10377221c73b29570388636ea8b25573e200f36b8be4a8d45151ee2683a
|
7
|
+
data.tar.gz: 15d28de13a08b264cfb10af94529a3734f3ace42353ecb3897da3e5b6fe376e0710074794947001da467a2e0366ae8d8efac1a62440f0233b1e383cff768001a
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
require: rubocop-rspec
|
3
3
|
|
4
|
+
Metrics/BlockLength:
|
5
|
+
Exclude:
|
6
|
+
- spec/**/*.rb
|
7
|
+
|
4
8
|
Metrics/LineLength:
|
5
9
|
Exclude:
|
6
10
|
- telegram-bot-ruby.gemspec
|
@@ -8,3 +12,7 @@ Metrics/LineLength:
|
|
8
12
|
|
9
13
|
Style/EmptyMethod:
|
10
14
|
EnforcedStyle: expanded
|
15
|
+
|
16
|
+
Style/PercentLiteralDelimiters:
|
17
|
+
PreferredDelimiters:
|
18
|
+
'%w': '()'
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,7 @@ Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/telegram-bot-ruby.svg)](http://badge.fury.io/rb/telegram-bot-ruby)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/atipugin/telegram-bot-ruby/badges/gpa.svg)](https://codeclimate.com/github/atipugin/telegram-bot-ruby)
|
7
7
|
[![Build Status](https://travis-ci.org/atipugin/telegram-bot-ruby.svg?branch=master)](https://travis-ci.org/atipugin/telegram-bot-ruby)
|
8
|
+
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks!-🦉-1EAEDB.svg)](https://saythanks.io/to/atipugin)
|
8
9
|
|
9
10
|
## Installation
|
10
11
|
|
data/lib/telegram/bot/api.rb
CHANGED
@@ -4,12 +4,13 @@ module Telegram
|
|
4
4
|
ENDPOINTS = %w(
|
5
5
|
getUpdates setWebhook deleteWebhook getWebhookInfo getMe sendMessage
|
6
6
|
forwardMessage sendPhoto sendAudio sendDocument sendSticker sendVideo
|
7
|
-
sendVoice sendLocation sendVenue sendContact
|
8
|
-
getUserProfilePhotos getFile kickChatMember
|
9
|
-
getChat getChatAdministrators
|
10
|
-
answerCallbackQuery editMessageText
|
11
|
-
editMessageReplyMarkup
|
12
|
-
|
7
|
+
sendVoice sendVideoNote sendLocation sendVenue sendContact
|
8
|
+
sendChatAction getUserProfilePhotos getFile kickChatMember
|
9
|
+
unbanChatMember leaveChat getChat getChatAdministrators
|
10
|
+
getChatMembersCount getChatMember answerCallbackQuery editMessageText
|
11
|
+
editMessageCaption editMessageReplyMarkup deleteMessage
|
12
|
+
answerInlineQuery sendInvoice answerShippingQuery answerPreCheckoutQuery
|
13
|
+
sendGame setGameScore getGameHighScores
|
13
14
|
).freeze
|
14
15
|
REPLY_MARKUP_TYPES = [
|
15
16
|
Telegram::Bot::Types::ReplyKeyboardMarkup,
|
data/lib/telegram/bot/client.rb
CHANGED
data/lib/telegram/bot/types.rb
CHANGED
@@ -6,6 +6,7 @@ require 'telegram/bot/types/document'
|
|
6
6
|
require 'telegram/bot/types/sticker'
|
7
7
|
require 'telegram/bot/types/video'
|
8
8
|
require 'telegram/bot/types/voice'
|
9
|
+
require 'telegram/bot/types/video_note'
|
9
10
|
require 'telegram/bot/types/contact'
|
10
11
|
require 'telegram/bot/types/location'
|
11
12
|
require 'telegram/bot/types/chat'
|
@@ -15,6 +16,10 @@ require 'telegram/bot/types/animation'
|
|
15
16
|
require 'telegram/bot/types/game'
|
16
17
|
require 'telegram/bot/types/callback_game'
|
17
18
|
require 'telegram/bot/types/game_high_score'
|
19
|
+
require 'telegram/bot/types/invoice'
|
20
|
+
require 'telegram/bot/types/shipping_address'
|
21
|
+
require 'telegram/bot/types/order_info'
|
22
|
+
require 'telegram/bot/types/successful_payment'
|
18
23
|
require 'telegram/bot/types/message'
|
19
24
|
require 'telegram/bot/types/input_message_content'
|
20
25
|
require 'telegram/bot/types/input_contact_message_content'
|
@@ -46,9 +51,13 @@ require 'telegram/bot/types/inline_query_result_video'
|
|
46
51
|
require 'telegram/bot/types/inline_query_result_voice'
|
47
52
|
require 'telegram/bot/types/chosen_inline_result'
|
48
53
|
require 'telegram/bot/types/callback_query'
|
54
|
+
require 'telegram/bot/types/shipping_query'
|
55
|
+
require 'telegram/bot/types/pre_checkout_query'
|
49
56
|
require 'telegram/bot/types/update'
|
50
57
|
require 'telegram/bot/types/keyboard_button'
|
51
58
|
require 'telegram/bot/types/reply_keyboard_markup'
|
52
59
|
require 'telegram/bot/types/reply_keyboard_remove'
|
53
60
|
require 'telegram/bot/types/force_reply'
|
54
61
|
require 'telegram/bot/types/file'
|
62
|
+
require 'telegram/bot/types/labeled_price'
|
63
|
+
require 'telegram/bot/types/shipping_option'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Telegram
|
2
|
+
module Bot
|
3
|
+
module Types
|
4
|
+
class Invoice < Base
|
5
|
+
attribute :title, String
|
6
|
+
attribute :description, String
|
7
|
+
attribute :start_parameter, String
|
8
|
+
attribute :currency, String
|
9
|
+
attribute :total_amount, Integer
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -21,11 +21,12 @@ module Telegram
|
|
21
21
|
attribute :sticker, Sticker
|
22
22
|
attribute :video, Video
|
23
23
|
attribute :voice, Voice
|
24
|
+
attribute :video_note, VideoNote
|
24
25
|
attribute :caption, String
|
25
26
|
attribute :contact, Contact
|
26
27
|
attribute :location, Location
|
27
28
|
attribute :venue, Venue
|
28
|
-
attribute :
|
29
|
+
attribute :new_chat_members, Array[User]
|
29
30
|
attribute :left_chat_member, User
|
30
31
|
attribute :new_chat_title, String
|
31
32
|
attribute :new_chat_photo, Array[PhotoSize]
|
@@ -36,6 +37,8 @@ module Telegram
|
|
36
37
|
attribute :migrate_to_chat_id, Integer
|
37
38
|
attribute :migrate_from_chat_id, Integer
|
38
39
|
attribute :pinned_message, Message
|
40
|
+
attribute :invoice, Invoice
|
41
|
+
attribute :successful_payment, SuccessfulPayment
|
39
42
|
|
40
43
|
alias to_s text
|
41
44
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Telegram
|
2
|
+
module Bot
|
3
|
+
module Types
|
4
|
+
class PreCheckoutQuery < Base
|
5
|
+
attribute :id, String
|
6
|
+
attribute :from, User
|
7
|
+
attribute :currency, String
|
8
|
+
attribute :total_amount, Integer
|
9
|
+
attribute :invoice_payload, String
|
10
|
+
attribute :shipping_option_id, String
|
11
|
+
attribute :order_info, OrderInfo
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Telegram
|
2
|
+
module Bot
|
3
|
+
module Types
|
4
|
+
class ShippingAddress < Base
|
5
|
+
attribute :country_code, String
|
6
|
+
attribute :state, String
|
7
|
+
attribute :city, String
|
8
|
+
attribute :street_line1, String
|
9
|
+
attribute :street_line2, String
|
10
|
+
attribute :post_code, String
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Telegram
|
2
|
+
module Bot
|
3
|
+
module Types
|
4
|
+
class SuccessfulPayment < Base
|
5
|
+
attribute :currency, String
|
6
|
+
attribute :total_amount, Integer
|
7
|
+
attribute :invoice_payload, String
|
8
|
+
attribute :shipping_option_id, String
|
9
|
+
attribute :order_info, OrderInfo
|
10
|
+
attribute :telegram_payment_charge_id, String
|
11
|
+
attribute :provider_payment_charge_id, String
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -10,6 +10,8 @@ module Telegram
|
|
10
10
|
attribute :inline_query, InlineQuery
|
11
11
|
attribute :chosen_inline_result, ChosenInlineResult
|
12
12
|
attribute :callback_query, CallbackQuery
|
13
|
+
attribute :shipping_query, ShippingQuery
|
14
|
+
attribute :pre_checkout_query, PreCheckoutQuery
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/telegram/bot/version.rb
CHANGED
data/telegram-bot-ruby.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency 'bundler', '~> 1.9'
|
24
24
|
spec.add_development_dependency 'rake', '~> 10.0'
|
25
25
|
spec.add_development_dependency 'pry'
|
26
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
26
|
+
spec.add_development_dependency 'rubocop', '~> 0.48.1'
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.4'
|
28
28
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.8'
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telegram-bot-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.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: 2017-
|
11
|
+
date: 2017-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.48.1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.48.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,18 +193,27 @@ files:
|
|
193
193
|
- lib/telegram/bot/types/input_message_content.rb
|
194
194
|
- lib/telegram/bot/types/input_text_message_content.rb
|
195
195
|
- lib/telegram/bot/types/input_venue_message_content.rb
|
196
|
+
- lib/telegram/bot/types/invoice.rb
|
196
197
|
- lib/telegram/bot/types/keyboard_button.rb
|
198
|
+
- lib/telegram/bot/types/labeled_price.rb
|
197
199
|
- lib/telegram/bot/types/location.rb
|
198
200
|
- lib/telegram/bot/types/message.rb
|
199
201
|
- lib/telegram/bot/types/message_entity.rb
|
202
|
+
- lib/telegram/bot/types/order_info.rb
|
200
203
|
- lib/telegram/bot/types/photo_size.rb
|
204
|
+
- lib/telegram/bot/types/pre_checkout_query.rb
|
201
205
|
- lib/telegram/bot/types/reply_keyboard_markup.rb
|
202
206
|
- lib/telegram/bot/types/reply_keyboard_remove.rb
|
207
|
+
- lib/telegram/bot/types/shipping_address.rb
|
208
|
+
- lib/telegram/bot/types/shipping_option.rb
|
209
|
+
- lib/telegram/bot/types/shipping_query.rb
|
203
210
|
- lib/telegram/bot/types/sticker.rb
|
211
|
+
- lib/telegram/bot/types/successful_payment.rb
|
204
212
|
- lib/telegram/bot/types/update.rb
|
205
213
|
- lib/telegram/bot/types/user.rb
|
206
214
|
- lib/telegram/bot/types/venue.rb
|
207
215
|
- lib/telegram/bot/types/video.rb
|
216
|
+
- lib/telegram/bot/types/video_note.rb
|
208
217
|
- lib/telegram/bot/types/voice.rb
|
209
218
|
- lib/telegram/bot/version.rb
|
210
219
|
- telegram-bot-ruby.gemspec
|
@@ -227,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
236
|
version: '0'
|
228
237
|
requirements: []
|
229
238
|
rubyforge_project:
|
230
|
-
rubygems_version: 2.
|
239
|
+
rubygems_version: 2.6.11
|
231
240
|
signing_key:
|
232
241
|
specification_version: 4
|
233
242
|
summary: Ruby wrapper for Telegram's Bot API
|