summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/irc.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/rbot/irc.rb b/lib/rbot/irc.rb
index 31d432fd..72579b19 100644
--- a/lib/rbot/irc.rb
+++ b/lib/rbot/irc.rb
@@ -1358,6 +1358,14 @@ module Irc
# Flags
@mode = {}
+ class << @mode
+ def any?(*ar)
+ !!ar.find { |m| s = m.to_sym ; self[s] && self[s].set? }
+ end
+ def all?(*ar)
+ !ar.find { |m| s = m.to_sym ; !(self[s] && self[s].set?) }
+ end
+ end
end
# Removes a user from the channel