telegram-bot 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6965124480bcaf8247399876641d9f7a27380592
4
- data.tar.gz: 4ac406cca75f4c864a07b0b98eca019aa4c39f9b
3
+ metadata.gz: d594181f45263c89878672c38ab96ca93f94d438
4
+ data.tar.gz: da24b6e674c33166608c756731775a7f38ad57cb
5
5
  SHA512:
6
- metadata.gz: 5c9cf79f27c144401dacd15cd59047ccf9a695070eca66b08537246f9aa061bb81bfb05954e8d720b84f9cd40b3bf30f40dfd43e75da8a49e76ae6bd4b4851f6
7
- data.tar.gz: 0262b407a6c583eeeff2fb3d3ef011d709bb1eba8f788b3cf80cb95a769e8d25deec7fcd9ce83d5404e4131188b76a39e014204ba257fdb790e3d4646e1f3a82
6
+ metadata.gz: 575c620d5ce534969b8f23b1c44bcfab81fc36d99e3804216b4ad7ad4438fe2c92116159dcc76bdab152fbc4db66ae69a8bb3e3205ebe7b038255711d69627ad
7
+ data.tar.gz: b8a73a25b7d49b60ad64a6d1cb19c9a4fe1e896f47a394d5175e7a374f0b79488f16410f2c68240ed8a7a08ade6c25a5c672b82e142d7cdddf3f7cb0abf90dbc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.11.1
2
+
3
+ # Fixed poller for typed response.
4
+
1
5
  # 0.11.0
2
6
 
3
7
  - Remove Bot::StaleChat in favor of Bot::Forbidden, as Telegram adds more
@@ -65,14 +65,16 @@ module Telegram
65
65
 
66
66
  def fetch_updates
67
67
  response = bot.async(false) { bot.get_updates(offset: offset, timeout: timeout) }
68
- return unless response['ok'] && response['result'].any?
68
+ updates = response.is_a?(Array) ? response : response['result']
69
+ return unless updates && updates.any?
69
70
  reload! do
70
- response['result'].each do |update|
71
+ updates.each do |update|
71
72
  @offset = update['update_id'] + 1
72
73
  yield update
73
74
  end
74
75
  end
75
- rescue Timeout::Error # rubocop:disable HandleExceptions
76
+ rescue Timeout::Error
77
+ log { 'Fetch timeout' }
76
78
  end
77
79
 
78
80
  def reload!
@@ -1,6 +1,6 @@
1
1
  module Telegram
2
2
  module Bot
3
- VERSION = '0.11.0'.freeze
3
+ VERSION = '0.11.1'.freeze
4
4
 
5
5
  def self.gem_version
6
6
  Gem::Version.new VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Melentiev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport