moonbot 0.0.5 → 0.0.6

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.
@@ -3,7 +3,11 @@ module MoonBot
3
3
  def self.parse data
4
4
  message = {}
5
5
  # if not empty
6
- if data.scan(/^:/)
6
+ if data.scan(/^:/).empty?
7
+ body = data.split ' '
8
+ message[:command] = body.shift
9
+ message[:args] = body
10
+ else
7
11
  separated = data.split ':'
8
12
  body = separated[1].split ' '
9
13
  message[:prefix] = body.shift
@@ -11,10 +15,6 @@ module MoonBot
11
15
  message[:params] = body.shift
12
16
  2.times { separated.shift }
13
17
  message[:trailing] = separated.join(":")
14
- else
15
- body = data.split ' '
16
- message[:command] = body.shift
17
- message[:args] = body
18
18
  end
19
19
  message
20
20
  rescue
@@ -1,3 +1,3 @@
1
1
  module MoonBot
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moonbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: