]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - data/rbot/plugins/host.rb
webhook: define number for watch/star actions too
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / host.rb
1 class HostPlugin < Plugin
2   Config.register Config::StringValue.new('host.path',
3      :default => 'host',
4      :desc => _('Path to the host program'))
5
6   def help(plugin, topic="")
7     "host <domain> => query nameserver about domain names and zones for <domain>"
8   end
9
10   def host_path
11     @bot.config["host.path"]
12   end
13
14   def privmsg(m)
15     unless(m.params =~ /^(\w|-|\.)+$/)
16       m.reply "incorrect usage: " + help(m.plugin)
17       return
18     end
19     m.reply Utils.safe_exec(host_path, m.params)
20   end
21 end
22 plugin = HostPlugin.new
23 plugin.register("host")