From 6ff901dfe723b58ad13a2e3693473d934f5751b2 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 21 Apr 2014 12:17:58 -0700 Subject: Modify modules to accept MessageInfo objects. --- module/config.rb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'module/config.rb') 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 -- cgit v1.2.3-70-g09d2