telegram_bot 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/telegram_bot/bot.rb +4 -2
- data/lib/telegram_bot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03c9fdf2dd790ac15831cf52dbf9731c5b25f90c
|
4
|
+
data.tar.gz: 37f347c7aa708b631ef28d2a4d0ac71901fbf71e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e42072bac136985ae7fc2136767f6f09bd1fc107ff894c8cb007826467187e7b9eb9f635740054c5399174c26e5b4146eb3d9b71c79392da1017acd475d019c1
|
7
|
+
data.tar.gz: fac54923bad631123829da3cfed92f2de772bc97c4adb39a93f5b8032ee55d40448a134977d9398b3f4a2fa9a7a5f60848bc217ef7a87a41a73cf2dfa71479c5
|
data/lib/telegram_bot/bot.rb
CHANGED
@@ -12,7 +12,8 @@ module TelegramBot
|
|
12
12
|
@timeout = opts[:timeout] || 50
|
13
13
|
@offset = opts[:offset] || 0
|
14
14
|
@logger = opts[:logger] || NullLogger.new
|
15
|
-
@
|
15
|
+
@proxy = opts[:proxy] || nil
|
16
|
+
@connection = Excon.new(ENDPOINT, persistent: true, proxy: @proxy)
|
16
17
|
end
|
17
18
|
|
18
19
|
def get_me
|
@@ -30,7 +31,8 @@ module TelegramBot
|
|
30
31
|
logger.info "starting get_updates loop"
|
31
32
|
loop do
|
32
33
|
messages = get_last_messages(opts)
|
33
|
-
messages.each do |message|
|
34
|
+
messages.compact.each do |message|
|
35
|
+
next unless message
|
34
36
|
logger.info "message from @#{message.chat.friendly_name}: #{message.text.inspect}"
|
35
37
|
yield message
|
36
38
|
end
|
data/lib/telegram_bot/version.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Tomás Albornoz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|