]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/factoids.rb
weather plugin: fix 163
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / factoids.rb
index e50cc73d11305855082b57071455d269271f262b..38793bec3c0df22a23d3b1ae501c1ae7490bb5b3 100644 (file)
@@ -161,12 +161,16 @@ class FactoidsPlugin < Plugin
       :who => m.source.fullform,
       :where => m.channel.to_s
     )
-    if @factoids.index(factoid)
-      m.reply _("I already know that %{factoid}" % { :factoid => factoid })
+    if idx = @factoids.index(factoid)
+      m.reply _("I already know that %{factoid} [#%{idx}]" % {
+        :factoid => factoid,
+        :idx => idx
+      })
     else
       @factoids << factoid
       @changed = true
       m.okay
+      fact(m, :index => @factoids.length.to_s)
     end
   end