botomizer 0.1.7 → 0.1.8

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: ffea29a66826bae04166449e185b9f4ef54ce99c
4
- data.tar.gz: e7a5ffba454e1ddb4d33f92248e11648dde00a83
3
+ metadata.gz: 9392d167e484a939fae7cf17c61c48967cc08424
4
+ data.tar.gz: 9d3c5b4edeb3aae97651e4b7f8dbd671bf3f9f28
5
5
  SHA512:
6
- metadata.gz: c9a1c5aca2949b844c5cbecedfb05c781de4b2d8fdbb13eba8b06f558d827b4432180929aac809b839f78e5185784a19f4096a61c2fb2f337966e4ca74b1b642
7
- data.tar.gz: 433bdd8eb803ec18e77b62fa0324ddfa1df321859bb51babad9fcaaecdc4aaaed3b342ab726482348b395fa9be9ac05596c083055acb5e917c9b70722aa5927c
6
+ metadata.gz: 0c2786368cf433d362ebc8d0e180daa1f1d2cc67f756780ea1d03f64fe8a9c06b944b852ab3382422bb544773d14bb8ad2fe387d91e5467d2f94cf2d89cbfd54
7
+ data.tar.gz: e616482db350f3a22fb438927ab97e1d9194fa149923618d0a2228eb8d23b2b1067d6501f3ed375727aab2b485cf4a914a20f69f31d2eeb4b0a6f3101791caa3
@@ -1,12 +1,12 @@
1
1
  class Botomizer::Message
2
2
  attr_accessor :id, :text, :cmd
3
3
 
4
- def initialize(params)
4
+ def initialize(params, options = {})
5
5
  @id = params[:id]
6
6
  @text = params[:text].to_s
7
7
 
8
8
  if @text.index('/') == 0
9
- sp = @text.split(' ')
9
+ sp = @text.gsub(options[:name] || '', '').split(' ')
10
10
  @cmd = sp.first.downcase.gsub!('/', '')
11
11
  @text = sp.drop(1).join(' ')
12
12
  end
@@ -15,9 +15,12 @@ module Botomizer::Telegram
15
15
 
16
16
  unless message_key.nil?
17
17
  message = request[message_key]
18
+
18
19
  @message = Botomizer::Message.new({
19
20
  id: message['message_id'],
20
21
  text: message['text']
22
+ }, {
23
+ name: @options[:name]
21
24
  })
22
25
  @chat = Botomizer::Chat.new({
23
26
  id: message['chat']['id'],
@@ -1,3 +1,3 @@
1
1
  module Botomizer
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
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.7
4
+ version: 0.1.8
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-17 00:00:00.000000000 Z
11
+ date: 2017-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler