telegramAPI 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -6
- data/lib/telegramAPI.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -51,7 +51,7 @@ token = "******"
|
|
51
51
|
api = TelegramAPI.new token
|
52
52
|
while true do
|
53
53
|
# Get last messages if there are, or wait 180 seconds for new messages
|
54
|
-
u=api.getUpdates
|
54
|
+
u=api.getUpdates({"timeout"=>180})
|
55
55
|
u.each do |m|
|
56
56
|
api.sendMessage(m.message.chat.id, m.message.text)
|
57
57
|
end
|
@@ -81,12 +81,13 @@ You can find the complete list of options at the offical [Telegram API Bots](htt
|
|
81
81
|
|
82
82
|
```ruby
|
83
83
|
markup = {
|
84
|
-
keyboard=>[["YES!", "Yes"], ["Well..", "No.."]],
|
84
|
+
"keyboard"=>[["YES!", "Yes"], ["Well..", "No.."]],
|
85
85
|
# Other optional settings:
|
86
|
-
resize_keyboard=>true,
|
87
|
-
one_time_keyboard=>true,
|
88
|
-
selective=>true,
|
89
|
-
force_reply=>true
|
86
|
+
"resize_keyboard"=>true,
|
87
|
+
"one_time_keyboard"=>true,
|
88
|
+
"selective"=>true,
|
89
|
+
"force_reply"=>true
|
90
|
+
# "hide_keyboard"=>true
|
90
91
|
}
|
91
92
|
|
92
93
|
api.sendMessage m.message.chat.id, "Am I sexy?", {"reply_markup"=>markup}
|
data/lib/telegramAPI.rb
CHANGED
@@ -46,7 +46,7 @@ class TelegramAPI
|
|
46
46
|
# Provide information about the bot itself
|
47
47
|
# @return [User] Information about the bot
|
48
48
|
def getMe
|
49
|
-
User.new self.query("getMe")
|
49
|
+
User.new self.query("getMe")["result"]
|
50
50
|
end
|
51
51
|
|
52
52
|
# Get last updates, including last received messages
|
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.0.
|
4
|
+
version: 1.0.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|