telegramAPI 1.2 → 1.2.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/lib/telegramAPI.rb +5 -5
- 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: cf59e092f4b48681343b6e8141146e4fc12fcd42
|
4
|
+
data.tar.gz: 1d57c5ae51722ed541fe5269b9524e979e1dafbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f9386146372a702adbf658e78d0a2ddc2d80e913c5e42caf083ee30a8bd84c303c97781a3c32191a306007fcd43ba76e000ea94c379d8318e3e063f65f3e923
|
7
|
+
data.tar.gz: f81bf7b70bb806b63822c79cef72d64be62b6fee98068737e53a9b7ddc1fcbef9aa23784e78268541832543f44a02b74767f9fa1a29bd7e7b6e2c55c0da99031
|
data/lib/telegramAPI.rb
CHANGED
@@ -31,7 +31,10 @@ class TelegramAPI
|
|
31
31
|
params.each do |param| p << param.join("=") end
|
32
32
|
params_s = "?#{p.join("&")}" if p.length!=0
|
33
33
|
|
34
|
-
JSON.parse(RestClient.get(@@core+@token+"/"+api+params_s).body)
|
34
|
+
r = JSON.parse(RestClient.get(@@core+@token+"/"+api+params_s).body)
|
35
|
+
if r['ok']!=true then return nil end
|
36
|
+
if r['result'][-1]!=nil then @last_update=r['result'][-1]['update_id']+1 end
|
37
|
+
return r["result"]
|
35
38
|
end
|
36
39
|
|
37
40
|
def post api, name, path, to, options={}
|
@@ -39,10 +42,7 @@ class TelegramAPI
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def getUpdates options={"timeout"=>0, "limit"=>100}
|
42
|
-
|
43
|
-
if r['ok']!=true then return nil end
|
44
|
-
if r['result'][-1]!=nil then @last_update=r['result'][-1]['update_id']+1 end
|
45
|
-
return r['result']
|
45
|
+
self.query "getUpdates", {"offset"=>@last_update.to_s}.merge(parse_hash(options))
|
46
46
|
end
|
47
47
|
|
48
48
|
def getMe
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telegramAPI
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benedetto Nespoli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|