From b7572e688c0d44b3632b6077a3e7a936af733568 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Fri, 12 Aug 2005 20:13:00 +0000 Subject: more fixes --- data/rbot/plugins/autoop.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'data') diff --git a/data/rbot/plugins/autoop.rb b/data/rbot/plugins/autoop.rb index 9da5bd37..6187cf4d 100644 --- a/data/rbot/plugins/autoop.rb +++ b/data/rbot/plugins/autoop.rb @@ -24,24 +24,27 @@ class AutoOP < Plugin m.reply @bot.lang.get('dunno') return end - if (params[:channels] && @registry[params[:mask]] != nil) + if (!params[:channels].empty? && @registry[params[:mask]] != nil) params[:channels].each do |c| @registry[params[:mask]] = @registry[params[:mask]].reject {|ele| ele =~ /^#{c}$/i} end - elsif(!@registry.delete(params[:mask])) - m.reply @bot.lang.get('dunno') + if @registry[params[:mask]].empty? + @registry.delete(params[:mask]) + end else - m.okay + @registry.delete(params[:mask]) end + m.okay end def list(m, params) - if(@registry.length) + debug @registry.length + if(@registry.length > 0) @registry.each { |mask,channels| m.reply "#{mask} in #{channels.empty? ? 'all channels' : channels.join(', ')}" } else - m.reply "No entrys" + m.reply "No entries" end end end -- cgit v1.2.3