]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Sun Aug 07 18:20:24 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
authorTom Gilbert <tom@linuxbrit.co.uk>
Sun, 7 Aug 2005 17:20:41 +0000 (17:20 +0000)
committerTom Gilbert <tom@linuxbrit.co.uk>
Sun, 7 Aug 2005 17:20:41 +0000 (17:20 +0000)
  * stop insult plugin being used to insult the bot

ChangeLog
data/rbot/plugins/insult.rb
lib/rbot/keywords.rb

index 9f2263b3cf475a5cbb0eef2301802a6a1d6fe098..57e04ad6ce3f9afe559e9a947294f321165c1c92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Aug 07 18:20:24 BST 2005  Tom Gilbert <tom@linuxbrit.co.uk>
+
+  * stop insult plugin being used to insult the bot
+
 Sun Aug 07 17:53:06 BST 2005  Tom Gilbert <tom@linuxbrit.co.uk>
 
   * workaround for people without YAML::load_file
index 5f0384e8379c14dd101c3829e712ced0c729a985..f610efc0cb2524866eab2cd7c0654d29dad09efc 100644 (file)
@@ -233,7 +233,11 @@ class InsultPlugin < Plugin
     elsif(m.params =~ /^me$/)
       prefix = "you are "
     else
-      prefix = "#{m.params} is "
+      who = m.params
+      if (who == @bot.nick)
+        who = m.sourcenick
+      end
+      prefix = "#{who} is "
     end
     insult = generate_insult
     @bot.say msgto, prefix + insult + suffix
index daf3b40b011f2399be63914cfea6af1b23924932..5de5a14af2ce03028404c9ddb453c967c95dfe16 100644 (file)
@@ -421,6 +421,8 @@ module Irc
         end
       else
         # in channel message, not to me
+        # TODO option to do if(m.message =~ /^(.*)$/, ie try any line as a
+        # keyword lookup.
         if(m.message =~ /^'(.*)$/ || (!@bot.config["keyword.address"] && m.message =~ /^(.*\S)\s*\?\s*$/))
           keyword m, $1, false if(@bot.auth.allow?("keyword", m.source))
         elsif(@bot.config["keyword.listen"] == true && (m.message =~ /^(.*?)\s+(is|are)\s+(.*)$/))