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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5908af78b73eaef8d683fb02b606ad041203f391
4
- data.tar.gz: 18158946da72c637aaa23d82cd8cd2abdc33e020
3
+ metadata.gz: 3dbc95ab81c8a1e5386d3b5690c06752c592761e
4
+ data.tar.gz: ee02a768ecb1e09de75b80e1ed1a80a3c534e816
5
5
  SHA512:
6
- metadata.gz: 4a6f8c84c1edf29e0c127ab29664a62090d5a1a287b096d4f977b6e40408848506884cc189d5c487cbf2a244f1410e4945252fbc02f05bfe3d00c4c60d8f28fb
7
- data.tar.gz: a51878749d1126c84511842540383143da90c0b075c97cb8ac26ec543ba338f6ce44ed449ccebcdf7e5830cd028412a4849aa86e6bb8fe76951ee74845d06a60
6
+ metadata.gz: 3223be4e311631c416bb7ce8a0113d23e8aae6d8f1f8e8c4a0f2846ebd2dae1a2ea450541b740c1d956d2817d0c8cf6512a18446e35c99e5429700407bc3c4aa
7
+ data.tar.gz: de487a638db1367eea44398b2c493951bc50ed49c0154beae928e000cf9b94d9bc23571ea02b59763b05a8e1cff99a000d9b00835f0fdac1c58ddb2fffaae1f3
@@ -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
@@ -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
- message = request[message_key]
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
  })
@@ -1,3 +1,3 @@
1
1
  module Botomizer
2
- VERSION = '0.1.9'
2
+ VERSION = '0.1.10'
3
3
  end
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.9
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-23 00:00:00.000000000 Z
11
+ date: 2017-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler