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 +4 -4
- data/README.md +1 -1
- data/lib/telegram/bot/api.rb +2 -2
- data/lib/telegram/bot/client.rb +4 -1
- data/lib/telegram/bot/types.rb +1 -0
- data/lib/telegram/bot/types/audio.rb +2 -0
- data/lib/telegram/bot/types/contact.rb +1 -1
- data/lib/telegram/bot/types/message.rb +2 -0
- data/lib/telegram/bot/types/video.rb +0 -1
- data/lib/telegram/bot/types/voice.rb +12 -0
- data/lib/telegram/bot/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52dcc8e74a2b19e6a4e90539f29df3a3c862bc39
|
4
|
+
data.tar.gz: 179ae66f674e396c7eab36550b3f80704768eeeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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'
|
data/lib/telegram/bot/api.rb
CHANGED
@@ -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
|
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,
|
data/lib/telegram/bot/client.rb
CHANGED
@@ -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
|
37
|
+
rescue *TIMEOUT_EXCEPTIONS
|
35
38
|
retry
|
36
39
|
end
|
37
40
|
|
data/lib/telegram/bot/types.rb
CHANGED
@@ -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'
|
@@ -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
|
data/lib/telegram/bot/version.rb
CHANGED
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.
|
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-
|
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
|