diff options
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/factoids.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/data/rbot/plugins/factoids.rb b/data/rbot/plugins/factoids.rb index 2a75fd52..51074221 100644 --- a/data/rbot/plugins/factoids.rb +++ b/data/rbot/plugins/factoids.rb @@ -271,6 +271,15 @@ class FactoidsPlugin < Plugin end end + def short_fact(fact,index=nil,total=@factoids.length) + idx = index || @factoids.index(fact)+1 + _("[%{idx}/%{total}] %{fact}" % { + :idx => idx, + :total => total, + :fact => fact.to_s(:meta => false) + }) + end + def long_fact(fact,index=nil,total=@factoids.length) idx = index || @factoids.index(fact)+1 _("fact #%{idx} of %{total}: %{fact}" % { @@ -316,10 +325,10 @@ class FactoidsPlugin < Plugin end end known.each { |f| - reply << long_fact(f) + reply << short_fact(f) } end - m.reply reply.join(" -- "), :split_at => /\s+--\s+/ + m.reply reply.join(". "), :split_at => /\s+--\s+/ end end |