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 /module/config.rb | |
parent | 6f983f20925e6c1b95649f221fb9fd419a44f025 (diff) | |
download | dinobot-6ff901dfe723b58ad13a2e3693473d934f5751b2.tar.gz dinobot-6ff901dfe723b58ad13a2e3693473d934f5751b2.tar.xz |
Modify modules to accept MessageInfo objects.
Diffstat (limited to 'module/config.rb')
-rw-r--r-- | module/config.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/module/config.rb b/module/config.rb index 2bf8b0b..fa3c151 100644 --- a/module/config.rb +++ b/module/config.rb @@ -12,23 +12,21 @@ module Dinobot @commands << :get << :set end - def get(user, channel, argument) - return unless @bot.modules[:admin].is_admin?(user) + def get(m, args) + return unless @bot.modules[:admin].is_admin?(m.user) - case argument + case args when 'trigger' - [[:say, channel, @config.data[:trigger][:global]]] + m.response << [:say, m.channel, @config.data[:trigger][:global]] when 'debug' - [[:say, channel, @config.data[:debug].to_s]] - else - nil + m.response << [:say, m.channel, @config.data[:debug].to_s] end end - def set(user, channel, argument) - return unless @bot.modules[:admin].is_admin?(user) + def set(m, args) + return unless @bot.modules[:admin].is_admin?(m.user) - key, val = argument.split(' ') + key, val = args.split(' ') return unless val case key @@ -45,8 +43,6 @@ module Dinobot @config.save end end - - nil end end end |