aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--echo.rb4
-rw-r--r--module.rb7
2 files changed, 5 insertions, 6 deletions
diff --git a/echo.rb b/echo.rb
index 4911ad0..34b9770 100644
--- a/echo.rb
+++ b/echo.rb
@@ -8,8 +8,8 @@ module Dinobot
@commands << :echo
end
- def echo(user, channel, message)
- [[:say, channel, message]]
+ def echo(user, channel, argument)
+ [[:say, channel, argument]]
end
end
end
diff --git a/module.rb b/module.rb
index f0c415a..c031a7b 100644
--- a/module.rb
+++ b/module.rb
@@ -7,15 +7,14 @@ module Dinobot
end
def call(user, channel, message)
- message = message.split(' ', 2).last
- command = message.split.first
+ command, argument = message.split(' ', 3)[1..2]
if @commands.include?(command.intern)
- send(command, user, channel, message)
+ send(command, user, channel, argument)
end
end
- def commands(user, channel, message)
+ def commands(user, channel, argument)
[[:say, channel, "Commands: #{@commands.sort.join(' ')}"]]
end
end