diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-02-16 23:57:10 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-02-16 23:57:10 +0100 |
commit | d19ed741f83e7b17f30152b0f82ff69a52755544 (patch) | |
tree | 9c360d835320c815e3a0ee1ac7522fda8e92d744 | |
parent | 44dcfe27b196bafb4fd3b6f1cf4e3256846d37c6 (diff) |
factoids: pass proper parameter from unreplied()
When passing on the Array of split words from unreplied() to facts()
make sure that the passed argument behaves like an Array/String from
the MessageMapper.
-rw-r--r-- | data/rbot/plugins/factoids.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/data/rbot/plugins/factoids.rb b/data/rbot/plugins/factoids.rb index 689b6d78..5b5e2b72 100644 --- a/data/rbot/plugins/factoids.rb +++ b/data/rbot/plugins/factoids.rb @@ -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 |