telegram-bot-ruby 0.3.0 → 0.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef037a3e5735ef90b436b1ef4929273ae596cf14
4
- data.tar.gz: 5f1c00b66ae94a56bcf6b55de44030ea5abf34e9
3
+ metadata.gz: 52dcc8e74a2b19e6a4e90539f29df3a3c862bc39
4
+ data.tar.gz: 179ae66f674e396c7eab36550b3f80704768eeeb
5
5
  SHA512:
6
- metadata.gz: 4f6242809b6c31ab7ff030ebb2d76a10165416d996a523a409f737511d33c42de0c597d9a57725b20816dd31f973ba3a5f85c02971c668814ec4ce085fa064c7
7
- data.tar.gz: cb4aa63e3eb65406959405f914dc09912449273adc9fd6131d06340e705e3d01d548f88247a8346efe3c94812dc745f281793aac165c28d73932e0ddcba9b2c6
6
+ metadata.gz: 7649ae7c24552d52d5c4a403c23ae688eb131e13c3184cae32144516137c891facc842b178321c95d8a58cd50300470cf7793d1d8e0e78d542abcfeda523f57b
7
+ data.tar.gz: 632ee6c2dc50f7216f3c81cf3a30d9e8a5ccfb72aeec68a646856b43960d4330fbbfe407e1463b141adb5df3518ff5c49770bd4af8cedc531e878c3d29fb6c51
data/README.md CHANGED
@@ -100,7 +100,7 @@ end
100
100
 
101
101
  ## Botan.io support
102
102
 
103
- Gem provides support of [Botan.io](http://botan.io/) analytics out of box. All you need is to obtain a token (follow the instructions from http://botan.io/). To track events you're interested in just call `#track` method. See example below:
103
+ Gem provides support of [Botan.io](http://botan.io/) analytics out of box. All you need is to obtain a token (follow the instructions from https://github.com/botanio/sdk). To track events you're interested in just call `#track` method. See example below:
104
104
 
105
105
  ```ruby
106
106
  require 'telegram/bot'
@@ -5,8 +5,8 @@ module Telegram
5
5
 
6
6
  ENDPOINTS = %w(
7
7
  getMe sendMessage forwardMessage sendPhoto sendAudio sendDocument
8
- sendSticker sendVideo sendLocation sendChatAction getUserProfilePhotos
9
- getUpdates setWebhook
8
+ sendSticker sendVideo sendVoice sendLocation sendChatAction
9
+ getUserProfilePhotos getUpdates setWebhook
10
10
  ).freeze
11
11
  REPLY_MARKUP_TYPES = [
12
12
  Telegram::Bot::Types::ReplyKeyboardMarkup,
@@ -1,6 +1,9 @@
1
1
  module Telegram
2
2
  module Bot
3
3
  class Client
4
+ TIMEOUT_EXCEPTIONS = [Timeout::Error]
5
+ TIMEOUT_EXCEPTIONS << Net::ReadTimeout if Net.const_defined?(:ReadTimeout)
6
+
4
7
  attr_reader :api, :offset, :timeout, :logger
5
8
 
6
9
  def self.run(*args, &block)
@@ -31,7 +34,7 @@ module Telegram
31
34
  yield update.message
32
35
  end
33
36
  end
34
- rescue Net::ReadTimeout
37
+ rescue *TIMEOUT_EXCEPTIONS
35
38
  retry
36
39
  end
37
40
 
@@ -6,6 +6,7 @@ require 'telegram/bot/types/photo_size'
6
6
  require 'telegram/bot/types/document'
7
7
  require 'telegram/bot/types/sticker'
8
8
  require 'telegram/bot/types/video'
9
+ require 'telegram/bot/types/voice'
9
10
  require 'telegram/bot/types/contact'
10
11
  require 'telegram/bot/types/location'
11
12
  require 'telegram/bot/types/message'
@@ -4,6 +4,8 @@ module Telegram
4
4
  class Audio < Base
5
5
  attribute :file_id, String
6
6
  attribute :duration, Integer
7
+ attribute :performer, String
8
+ attribute :title, String
7
9
  attribute :mime_type, String
8
10
  attribute :file_size, Integer
9
11
  end
@@ -5,7 +5,7 @@ module Telegram
5
5
  attribute :phone_number, String
6
6
  attribute :first_name, String
7
7
  attribute :last_name, String
8
- attribute :user_id, String
8
+ attribute :user_id, Integer
9
9
  end
10
10
  end
11
11
  end
@@ -16,6 +16,8 @@ module Telegram
16
16
  attribute :photo, Array[PhotoSize]
17
17
  attribute :sticker, Sticker
18
18
  attribute :video, Video
19
+ attribute :voice, Voice
20
+ attribute :caption, String
19
21
  attribute :contact, Contact
20
22
  attribute :location, Location
21
23
  attribute :new_chat_participant, User
@@ -9,7 +9,6 @@ module Telegram
9
9
  attribute :thumb, PhotoSize
10
10
  attribute :mime_type, String
11
11
  attribute :file_size, Integer
12
- attribute :caption, String
13
12
  end
14
13
  end
15
14
  end
@@ -0,0 +1,12 @@
1
+ module Telegram
2
+ module Bot
3
+ module Types
4
+ class Voice < Base
5
+ attribute :file_id, String
6
+ attribute :duration, Integer
7
+ attribute :mime_type, String
8
+ attribute :file_size, Integer
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module Telegram
2
2
  module Bot
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tipugin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-21 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httmultiparty
@@ -149,6 +149,7 @@ files:
149
149
  - lib/telegram/bot/types/update.rb
150
150
  - lib/telegram/bot/types/user.rb
151
151
  - lib/telegram/bot/types/video.rb
152
+ - lib/telegram/bot/types/voice.rb
152
153
  - lib/telegram/bot/version.rb
153
154
  - telegram-bot-ruby.gemspec
154
155
  homepage: https://github.com/atipugin/telegram-bot