From 36ae5303a60a19dd3ad4c84f882ca893cce0d0e2 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 14 Apr 2014 02:41:56 -0700 Subject: Don't pass extraneous command name to commands. --- module.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'module.rb') 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 -- cgit v1.2.3-70-g09d2