telegram-bot-ruby 0.2.3 → 0.2.4

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: fc02bc023f78d7da9e4607bee3143d52ca989c25
4
- data.tar.gz: ecf790855c851e7c734c22865dc98c4e3fc500c0
3
+ metadata.gz: b9f0ea70d6518a6c8151a83e6ab922c3b4724b49
4
+ data.tar.gz: 2397c4d6744e443e3f9aae921566c130547ae870
5
5
  SHA512:
6
- metadata.gz: fc691a2a817862a4e6e9b8efa397aa09e9a2ecd0b8db5aff82f43cf49d7233c71bd57d8a7d929a3d34fddc41194d7b908058719c266cde7bf19888121d13a9db
7
- data.tar.gz: fc072d1f9e4adc8da775812777b56143fdad49aea2a3ac27a3cb641c6caeb0afe670848746c8fcd8f318231bde48248a401f3d22dc932ee58fdab6e93492c721
6
+ metadata.gz: ac7225aaedd1f4261b6967b9788cf8e4836303434691ef771fe9eb97d32de77855d17220fe263d6dc25b8e504e5f056869bef85416b69cd245adf28eee3457ee
7
+ data.tar.gz: 89ed4164c4173139cdaaa98865d731b0442af459d605289f632bfb67a606f267b6e8d3391347914d73b31b2af8b32ddbf5b8012325eb09f47256dfa7a194e590
data/README.md CHANGED
@@ -74,7 +74,7 @@ end
74
74
 
75
75
  ## File upload
76
76
 
77
- Your bot can even upload files to Telegram servers (i.e. https://core.telegram.org/bots/api#sendphoto). Just like this:
77
+ Your bot can even upload files ([photos](https://core.telegram.org/bots/api#sendphoto), [audio](https://core.telegram.org/bots/api#sendaudio), [documents](https://core.telegram.org/bots/api#senddocument), [stickers](https://core.telegram.org/bots/api#sendsticker), [video](https://core.telegram.org/bots/api#sendvideo)) to Telegram servers. Just like this:
78
78
 
79
79
  ```ruby
80
80
  bot.listen do |message|
@@ -1,15 +1,16 @@
1
1
  module Telegram
2
2
  module Bot
3
3
  class Client
4
- attr_reader :api, :offset
4
+ attr_reader :api, :offset, :timeout
5
5
 
6
6
  def self.run(*args, &block)
7
7
  new(*args).run(&block)
8
8
  end
9
9
 
10
- def initialize(token)
10
+ def initialize(token, timeout = 20)
11
11
  @api = Api.new(token)
12
12
  @offset = 0
13
+ @timeout = timeout
13
14
  end
14
15
 
15
16
  def run
@@ -18,7 +19,7 @@ module Telegram
18
19
 
19
20
  def listen
20
21
  loop do
21
- response = api.getUpdates(offset: offset)
22
+ response = api.getUpdates(offset: offset, timeout: timeout)
22
23
  next unless response['ok']
23
24
 
24
25
  response['result'].each do |data|
@@ -1,5 +1,5 @@
1
1
  module Telegram
2
2
  module Bot
3
- VERSION = '0.2.3'
3
+ VERSION = '0.2.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tipugin