]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/chucknorris.rb
Some tweaks to the new Fact-about-anyone funcitonality.
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / chucknorris.rb
index 5c64de6945e5669d8904a80c06c15c3285d138ab..0b1b3a03b94da37bd8eaba204d87ac60bf8d6095 100644 (file)
@@ -24,8 +24,16 @@ class ChuckNorrisPlugin < Plugin
     end\r
     
     # pick a random person\r
-    if who == 'random'\r
-      who = FACTMAP.keys[rand(FACTMAP.length)]\r
+    if who == 'random'
+      if substitute_name
+        # take out the Mr. T facts if you're inserting someone's name
+        # beacuse tons of them suck, and most of them revolve around
+        # "pitying" someone or something.
+        people = FACTMAP.keys - ["mrt"]
+        who = people[rand(people.length)]
+      else
+        who = FACTMAP.keys[rand(FACTMAP.length)]
+      end\r
     end\r
     
     # get the long name\r