### Home Classes Methods

### In Files

- lib/rbot/core/filters_ui.rb

### Parent

CoreBotModule

### Methods

- ::new
- #do_list
- #do_listgroups
- #do_search
- #help

### Class/Module Index

Quicksearch

- Irc
- Irc::AsciiCasemap
- Irc::BanlistMessage
- Irc::BasicUserMessage
- Irc::Bot
- Irc::Bot::Auth
- Irc::Bot::Auth::BotOwnerClass
- Irc::Bot::Auth::BotUser
- Irc::Bot::Auth::Command
- Irc::Bot::Auth::DefaultBotUserClass
- Irc::Bot::Auth::InvalidPassword
- Irc::Bot::Auth::ManagerClass
- Irc::Bot::Auth::PermissionSet
- Irc::Bot::Config
- Irc::Bot::Config::ArrayValue
- Irc::Bot::Config::BooleanValue
- Irc::Bot::Config::EnumValue
- Irc::Bot::Config::FloatValue
- Irc::Bot::Config::IntegerValue
- Irc::Bot::Config::ManagerClass
- Irc::Bot::Config::StringValue
- Irc::Bot::Config::Value
- Irc::Bot::Config::Wizard
- Irc::Bot::DataFilter
- Irc::Bot::DataStream
- Irc::Bot::Language
- Irc::Bot::MessageMapper
- Irc::Bot::MessageMapper::Failure
- Irc::Bot::MessageMapper::FriendlyFailure
- Irc::Bot::MessageMapper::NoActionFailure
- Irc::Bot::MessageMapper::NoMatchFailure
- Irc::Bot::MessageMapper::NotPrivateFailure
- Irc::Bot::MessageMapper::NotPublicFailure
- Irc::Bot::MessageMapper::PartialMatchFailure
- Irc::Bot::MessageParameter
- Irc::Bot::MessageTemplate
- Irc::Bot::Plugins
- Irc::Bot::Plugins::BotModule
- Irc::Bot::Plugins::CoreBotModule
- Irc::Bot::Plugins::Plugin
- Irc::Bot::Plugins::PluginManagerClass
- Irc::Bot::Plugins::RecurseTooDeep
- Irc::Bot::Plugins::RemoteBotModule
- Irc::Bot::Plugins::RemoteCoreBotModule
- Irc::Bot::Plugins::RemotePlugin
- Irc::Bot::Registry
- Irc::Bot::Registry::Accessor
- Irc::Bot::RemoteDispatcher
- Irc::Bot::RemoteMessage
- Irc::Bot::RemoteObject
- Irc::Bot::Wordlist
- Irc::BotConfig
- Irc::Casemap
- Irc::Channel
- Irc::Channel::Mode
- Irc::Channel::ModeHash
- Irc::Channel::ModeTypeA
- Irc::Channel::ModeTypeB
- Irc::Channel::ModeTypeC
- Irc::Channel::ModeTypeD
- Irc::Channel::Topic
- Irc::Channel::UserMode
- Irc::ChannelList
- Irc::Client
- Irc::DBHash
- Irc::DBTree
- Irc::InviteMessage
- Irc::JoinMessage
- Irc::KickMessage
- Irc::MessageQueue
- Irc::ModeChangeMessage
- Irc::MotdMessage
- Irc::NamesMessage
- Irc::Netmask
- Irc::NetmaskDb
- Irc::NetmaskDb::Tree
- Irc::NetmaskList
- Irc::NickMessage
- Irc::NoSuchTargetMessage
- Irc::NoticeMessage
- Irc::PartMessage
- Irc::PrivMessage
- Irc::QueueRing
- Irc::QuitMessage
- Irc::RfcCasemap
- Irc::Server
- Irc::ServerOrCasemap
- Irc::Socket
- Irc::Socket::IdentityFilter
- Irc::StrictRfcCasemap
- Irc::TopicMessage
- Irc::UnknownMessage
- Irc::User
- Irc::UserList
- Irc::UserMessage
- Irc::Utils
- Irc::Utils::HttpUtil
- Irc::Utils::HttpUtil::CachedObject
- Irc::Utils::ParseTime
- Irc::WelcomeMessage
- Irc::WhoisMessage
- BDB
- BDB::CIBtree
- MonitorMixin
- MonitorMixin::ConditionVariable
- Net
- Net::HTTPResponse
- Regexp
- Regexp::Irc
- Singleton
- Singleton::SingletonClassMethods
- Timer
- Timer::Action
- TokyoCabinet
- TokyoCabinet::CIBDB
- UnicodePlugin
- UnicodePlugin::UnicodeFilter
- Array
- ArrayOf
- AuthModule
- BasicsModule
- ConditionVariable
- ConfigModule
- DottedIndex
- Enumerable
- Exception
- FiltersModule
- GetText
- GetTextVersionError
- HttpUtilPlugin
- IrcLogModule
- Module
- Numeric
- Object
- Range
- RemoteModule
- ServerError
- String
- Symbol
- UserDataModule
- WordlistModule
- YAML

No matching classes.

# FiltersModule

Author | Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>

### Public Class Methods

new() click to toggle source

    # File lib/rbot/core/filters_ui.rb, line 10
    def initialize
      super
      @bot.clear_filters
      @bot.register_filter(:htmlinfo) { |s| Utils.get_html_info(s.to_s, s) }
    end

### Public Instance Methods

do_list(m, params) click to toggle source

    # File lib/rbot/core/filters_ui.rb, line 20
    def do_list(m, params)
      g = params[:group]
      ar = @bot.filter_names(g).map { |s| s.to_s }.sort!
      if ar.empty?
        if g
          msg = _("no filters in group %{g}") % {:g => g}
        else
          msg = _("no known filters")
        end
      else
        msg = _("known filters: ") << ar.join(", ")
      end
      m.reply msg
    end

do_listgroups(m, params) click to toggle source

    # File lib/rbot/core/filters_ui.rb, line 35
    def do_listgroups(m, params)
      ar = @bot.filter_groups.map { |s| s.to_s }.sort!
      if ar.empty?
        msg = _("no known filter groups")
      else
        msg = _("known filter groups: ") << ar.join(", ")
      end
      m.reply msg
    end

do_search(m, params) click to toggle source

    # File lib/rbot/core/filters_ui.rb, line 45
    def do_search(m, params)
      l = @bot.filter_names.map { |s| s.to_s }
      pat = params[:pat].to_s
      sl = l.grep(Regexp.new(pat))
      if sl.empty?
        msg = _("no filters match %{pat}") % { :pat => pat }
      else
        msg = _("filters matching %{pat}: ") % { :pat => pat }
        msg << sl.sort!.join(", ")
      end
      m.reply msg
    end

help(plugin, topic="") click to toggle source

    # File lib/rbot/core/filters_ui.rb, line 16
    def help(plugin, topic="")
      "filters list [<group>] => list filters (in group <group>) | filters search <pat> => list filters matching regexp <pat>"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.