telegruby 1.2 → 2.0
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/telegruby.rb +2 -10
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94928a319248bb2efacecc5bda88940559b35c29
|
|
4
|
+
data.tar.gz: 557beef0e549571c0a4f91ab3f6cbc0aa5273cb3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c9b02bbea17b53f96a30ee57296e051632ab41274fd816a4612f7b43928d7a273929635c89080fd10e5954cc1effd36b34c3f5383fbea12a7cfdb8f62a46c17
|
|
7
|
+
data.tar.gz: def73818660374f72a1aec197a1c28a890bbde3454b918970a969ef64df405c6b588fcdb7ee876ca6a9ab8c256a456536a7d7a3cc87513a346a8b285123252b0
|
data/lib/telegruby.rb
CHANGED
|
@@ -34,7 +34,7 @@ module Telegruby
|
|
|
34
34
|
@id = (update.result.last.update_id + 1)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
return update
|
|
37
|
+
return update.result.map { |m| Message.new(m) }
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
# Send a plaintext message to a chat id
|
|
@@ -313,13 +313,6 @@ module Telegruby
|
|
|
313
313
|
return false
|
|
314
314
|
end
|
|
315
315
|
end
|
|
316
|
-
|
|
317
|
-
# Given an Update object, gets messages as structs.
|
|
318
|
-
def collect_msgs(update)
|
|
319
|
-
update.result.map { |msg|
|
|
320
|
-
Message.new(msg)
|
|
321
|
-
}
|
|
322
|
-
end
|
|
323
316
|
|
|
324
317
|
# Update object generated by
|
|
325
318
|
# Telegruby::Bot::get_updates
|
|
@@ -329,8 +322,7 @@ module Telegruby
|
|
|
329
322
|
end
|
|
330
323
|
end
|
|
331
324
|
|
|
332
|
-
# Message structure
|
|
333
|
-
# collect_msgs from an update hash.
|
|
325
|
+
# Message structure.
|
|
334
326
|
# Has some convenience methods.
|
|
335
327
|
class Message < OpenStruct
|
|
336
328
|
def initialize(hash_msg)
|
metadata
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: telegruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '
|
|
4
|
+
version: '2.0'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- Rose
|
|
8
8
|
- Rei
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
@@ -18,7 +18,7 @@ extensions: []
|
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
20
|
- lib/telegruby.rb
|
|
21
|
-
homepage: https://github.com/
|
|
21
|
+
homepage: https://github.com/monad/telegruby
|
|
22
22
|
licenses:
|
|
23
23
|
- MIT
|
|
24
24
|
metadata: {}
|
|
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
38
38
|
version: '0'
|
|
39
39
|
requirements: []
|
|
40
40
|
rubyforge_project:
|
|
41
|
-
rubygems_version: 2.
|
|
41
|
+
rubygems_version: 2.5.1
|
|
42
42
|
signing_key:
|
|
43
43
|
specification_version: 4
|
|
44
44
|
summary: Telegram Bot API library.
|