telegramAPI 1.2.3 → 1.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/telegramAPI.rb +2 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55cf3e884f244153fe068f58ebc644401e233970
4
- data.tar.gz: a7c174c9cbd2bf7a039b605d5323dec2cf2532f3
3
+ metadata.gz: 5d4007d59110d69e1e180e4bd53f9036c43b1025
4
+ data.tar.gz: 93077c4270ec299282fa640b06d0b3fcff9655ac
5
5
  SHA512:
6
- metadata.gz: 49d787b8f0280b584f045aab23c6bbe567d9e9146de6b247932890fc8cecd7ac23f92bc268fa264e8af1b6bfd2f53cb3eacbbc75e7ea2e0a45381bb321aca089
7
- data.tar.gz: af2dcdbb269b4462f480f99dbbf6c07ffbc57b837f0e6ec2729430164b0969353dbf976d5e31435eb3f1be5d3ba119c7a82d855ad731815d57945cfa3390d64b
6
+ metadata.gz: 86b6196c0b81594b87c0b44189ab9724b71ab05cf5f54b089a78674e1369e1323f55152ce1948d22cc790b509e90bfe8f7c85ab199f01310c799d87d42b695c1
7
+ data.tar.gz: 9c2d8f8a1c600cd65b089ad1fd05d714245ddda88c83a3b8aaab9f23dfafc6f26ec34ed43709811785b59ff2d23c65776a8fd3fe1ce1d4c837eb32ffb8c6bef5
@@ -25,13 +25,7 @@ class TelegramAPI
25
25
  end
26
26
 
27
27
  def query api, params={}
28
- p=[]
29
- params_s=""
30
-
31
- params.each do |param| p << param.join("=") end
32
- params_s = "?#{p.join("&")}" if p.length!=0
33
-
34
- r = JSON.parse(RestClient.get(@@core+@token+"/"+api+params_s).body)
28
+ r = JSON.parse(RestClient.post(@@core+@token+"/"+api, params).body)
35
29
  if r['result'].class==Array and r['result'][-1]!=nil then @last_update=r['result'][-1]['update_id']+1 end
36
30
  return r["result"]
37
31
  end
@@ -56,7 +50,7 @@ class TelegramAPI
56
50
  if options.has_key?"reply_markup" then
57
51
  options["reply_markup"]=options["reply_markup"].to_json
58
52
  end
59
- self.query("sendMessage", {:chat_id=>to.to_s, :text=>URI::encode(text)}.merge(parse_hash(options)))
53
+ self.query("sendMessage", {:chat_id=>to.to_s, :text=>text}.merge(parse_hash(options)))
60
54
  end
61
55
 
62
56
  def forwardMessage to, from, msg
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegramAPI
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benedetto Nespoli