]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/factoids.rb
lastfm: require num parameter for lastfm action to be an integer
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / factoids.rb
index 3192aa00e450d211de79f7aa9a0cad1ca944a5ac..5b5e2b7204f7bea44d388268a80a897b21ed5411 100644 (file)
@@ -120,7 +120,7 @@ class FactoidsPlugin < Plugin
     super
 
     # TODO config
-    @dir = File.join(@bot.botclass,"factoids")
+    @dir = datafile
     @filename = "factoids.rbot"
     @factoids = FactoidList.new
     @triggers = Set.new
@@ -379,7 +379,12 @@ class FactoidsPlugin < Plugin
       return if @triggers.empty?
       query = $1.strip.downcase
       if @triggers.include?(query)
-        facts(m, :words => query.split)
+        words = query.split
+        words.instance_variable_set(:@string_value, query)
+        def words.to_s
+          @string_value
+        end
+        facts(m, :words => words)
       end
     else
       return if m.address? # we don't learn stuff directed at us which is not an explicit learn command