summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/irc.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rbot/irc.rb b/lib/rbot/irc.rb
index c893fc27..ebfbaed3 100644
--- a/lib/rbot/irc.rb
+++ b/lib/rbot/irc.rb
@@ -1323,6 +1323,13 @@ module Irc
#
class Channel
+ # Return the non-prefixed part of a channel name.
+ # Also works with ## channels found on some networks
+ # (e.g. FreeNode)
+ def self.npname(str)
+ return str.to_s.sub(/^[&#+!]+/,'')
+ end
+
include ServerOrCasemap
attr_reader :name, :topic, :mode, :users
alias :to_s :name