botomizer 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/botomizer/message.rb +5 -1
- data/lib/botomizer/telegram.rb +8 -3
- data/lib/botomizer/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: 3dbc95ab81c8a1e5386d3b5690c06752c592761e
|
4
|
+
data.tar.gz: ee02a768ecb1e09de75b80e1ed1a80a3c534e816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3223be4e311631c416bb7ce8a0113d23e8aae6d8f1f8e8c4a0f2846ebd2dae1a2ea450541b740c1d956d2817d0c8cf6512a18446e35c99e5429700407bc3c4aa
|
7
|
+
data.tar.gz: de487a638db1367eea44398b2c493951bc50ed49c0154beae928e000cf9b94d9bc23571ea02b59763b05a8e1cff99a000d9b00835f0fdac1c58ddb2fffaae1f3
|
data/lib/botomizer/message.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Botomizer::Message
|
2
|
-
attr_accessor :id, :text, :cmd
|
2
|
+
attr_accessor :id, :text, :cmd, :data
|
3
3
|
|
4
4
|
def initialize(params, options = {})
|
5
5
|
@id = params[:id]
|
@@ -19,4 +19,8 @@ class Botomizer::Message
|
|
19
19
|
def text?
|
20
20
|
!@text.blank?
|
21
21
|
end
|
22
|
+
|
23
|
+
def data?
|
24
|
+
!@text.blank?
|
25
|
+
end
|
22
26
|
end
|
data/lib/botomizer/telegram.rb
CHANGED
@@ -9,16 +9,21 @@ module Botomizer::Telegram
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def parse_request(request)
|
12
|
-
message_key = ['message', 'edited_message', 'channel_post', 'edited_channel_post'].find do |key|
|
12
|
+
message_key = ['message', 'edited_message', 'channel_post', 'edited_channel_post', 'callback_query'].find do |key|
|
13
13
|
request.has_key?(key)
|
14
14
|
end
|
15
15
|
|
16
16
|
unless message_key.nil?
|
17
|
-
|
17
|
+
if message_key == 'callback_query'
|
18
|
+
message = request[message_key]['message']
|
19
|
+
else
|
20
|
+
message = request[message_key]
|
21
|
+
end
|
18
22
|
|
19
23
|
@message = Botomizer::Message.new({
|
20
24
|
id: message['message_id'],
|
21
|
-
text: message['text']
|
25
|
+
text: message['text'],
|
26
|
+
data: message['data']
|
22
27
|
}, {
|
23
28
|
name: @options[:name]
|
24
29
|
})
|
data/lib/botomizer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: botomizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Belenky
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|