]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - lib/rbot/core/wordlist_ui.rb
20ccc228b03d3dbad7c7325cc0daa100d65cc2d4
[user/henk/code/ruby/rbot.git] / lib / rbot / core / wordlist_ui.rb
1 #-- vim:sw=2:et
2 #++
3 #
4 # :title: wordlist management from IRC
5 #
6 # Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
7
8 class WordlistModule < CoreBotModule
9   def help(plugin, topic="")
10     _("wordlist list [<pattern>] => list wordlists (matching <pattern>)")
11   end
12
13   def do_list(m, p)
14     found = Wordlist.list(p)
15     if found.empty?
16       m.reply _("no wordlist found")
17     else
18       m.reply _("Wordlists: %{found}") % {
19         :found => found.sort.join(', ')
20       }
21     end
22   end
23 end
24
25 plugin = WordlistModule.new
26
27 plugin.map "wordlist list [:pattern]", :action => :do_list