diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-21 12:17:58 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-21 12:17:58 -0700 |
commit | 6ff901dfe723b58ad13a2e3693473d934f5751b2 (patch) | |
tree | 010a86fccc8ec0fcef0256c7cc06516308cab92f /dinobot.rb | |
parent | 6f983f20925e6c1b95649f221fb9fd419a44f025 (diff) | |
download | dinobot-6ff901dfe723b58ad13a2e3693473d934f5751b2.tar.gz dinobot-6ff901dfe723b58ad13a2e3693473d934f5751b2.tar.xz |
Modify modules to accept MessageInfo objects.
Diffstat (limited to 'dinobot.rb')
-rw-r--r-- | dinobot.rb | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -137,22 +137,21 @@ module Dinobot mod = mod.intern if m.response.empty? - m.response = @modules[mod].call(m.user, m.channel, command) + @modules[mod].call(m, command) else ensure_valid_response(m.response) - response = [] - m.response.each do |x| + prev = m.response + m.response = [] + + prev.each do |x| if x.first == :say - tmp = @modules[mod].call(m.user, x[1], "#{command} #{x[2]}") - ensure_valid_response(tmp) - response.concat(tmp) + @modules[mod].call(m, "#{command} #{x[2]}") + ensure_valid_response(m.response) else - response << x + m.response << x end end - - m.response = response end exec_command(m, remainder) if remainder |