summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-08-12 20:13:00 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-08-12 20:13:00 +0000
commitb7572e688c0d44b3632b6077a3e7a936af733568 (patch)
tree87a210de4ed98be97b7197da115b6421b33b530e
parent3196b989866d1f136e9eb16d688bb0680bbfca9b (diff)
more fixes
-rw-r--r--data/rbot/plugins/autoop.rb15
1 files changed, 9 insertions, 6 deletions
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