+ end
+
+ # HELP!
+ def help(plugin, topic="chuck")
+ "fact|chuck|norris|chucknorris [min_rating] => \"fact\" shows a random Chuck Norris fact (optional minimum rating from 1-10, default=6.0)."
+ #\"fact [person]\" shows a fact about someone in the channel.
+ end
+
+ # The meat.
+ def fact(m, params)
+ min = params[:minrating].to_f
+ debug "+ Getting Chuck Norris fact (rating > #{min})..."
+
+ viable_facts = @@facts.select {|rating, fact| rating >= min}
+ if viable_facts.empty?
+ debug " - no facts found with rating >= #{min}"
+ m.reply "Are you nuts?!? There are no facts better than #{min}!!!"
+ return
+ end
+
+ rating, fact = viable_facts[rand(viable_facts.length)]
+ m.reply "#{fact} [score=#{rating}]"