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 +4 -4
- data/lib/botomizer/message.rb +2 -2
- data/lib/botomizer/telegram.rb +3 -0
- 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: 9392d167e484a939fae7cf17c61c48967cc08424
|
4
|
+
data.tar.gz: 9d3c5b4edeb3aae97651e4b7f8dbd671bf3f9f28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c2786368cf433d362ebc8d0e180daa1f1d2cc67f756780ea1d03f64fe8a9c06b944b852ab3382422bb544773d14bb8ad2fe387d91e5467d2f94cf2d89cbfd54
|
7
|
+
data.tar.gz: e616482db350f3a22fb438927ab97e1d9194fa149923618d0a2228eb8d23b2b1067d6501f3ed375727aab2b485cf4a914a20f69f31d2eeb4b0a6f3101791caa3
|
data/lib/botomizer/message.rb
CHANGED
@@ -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
|
data/lib/botomizer/telegram.rb
CHANGED
@@ -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'],
|
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.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-
|
11
|
+
date: 2017-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|