diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-14 02:41:56 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-14 02:41:56 -0700 |
commit | 36ae5303a60a19dd3ad4c84f882ca893cce0d0e2 (patch) | |
tree | 39d7290f6434e892bba3efbb14aad45b6f55b179 /module.rb | |
parent | f35ae6761d9656ec51bd9176a83320c5dcf44278 (diff) | |
download | dinobot-36ae5303a60a19dd3ad4c84f882ca893cce0d0e2.tar.gz dinobot-36ae5303a60a19dd3ad4c84f882ca893cce0d0e2.tar.xz |
Don't pass extraneous command name to commands.
Diffstat (limited to 'module.rb')
-rw-r--r-- | module.rb | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 |