X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fwserver.rb;h=fb4738c173a13bcd6e662227478e5c6c97071d34;hb=676dd61e6b0bea5f506d064039a685944aefd6fb;hp=e1fe10bd341f1eafc675659c566612c3d4db8793;hpb=438d56ceb82755961229d222d82a1c22ce04ab1d;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/wserver.rb b/data/rbot/plugins/wserver.rb index e1fe10bd..fb4738c1 100644 --- a/data/rbot/plugins/wserver.rb +++ b/data/rbot/plugins/wserver.rb @@ -6,14 +6,10 @@ class WserverPlugin < Plugin def help(plugin, topic="") "wserver => try and determine what webserver is using" end - def privmsg(m) - unless(m.params && m.params =~ /^\S+$/) - m.reply "incorrect usage: " + help(m.plugins) - return - end + def wserver(m, params) redirect_count = 0 - hostname = m.params.dup + hostname = params[:host].dup hostname = "http://#{hostname}" unless hostname =~ /:\/\// begin if(redirect_count > 3) @@ -24,7 +20,7 @@ class WserverPlugin < Plugin begin uri = URI.parse(hostname) rescue URI::InvalidURIError => err - m.reply "#{m.params} is not a valid URI" + m.reply "#{hostname} is not a valid URI" return end @@ -72,4 +68,4 @@ class WserverPlugin < Plugin end end plugin = WserverPlugin.new -plugin.register("wserver") +plugin.map 'wserver :host'