diff options
-rw-r--r-- | lib/rbot/messagemapper.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb index 5c3ddc05..1682e902 100644 --- a/lib/rbot/messagemapper.rb +++ b/lib/rbot/messagemapper.rb @@ -177,8 +177,11 @@ module Irc # Verify uniqueness of each component. @items.inject({}) do |seen, item| if item.kind_of? Symbol - raise ArgumentError, "Illegal template -- duplicate item #{item}\n #{str.inspect}" if seen.key? item - seen[item] = true + # We must remove the initial * when present, + # because the parameters hash will intern both :item and *item as :item + it = item.to_s.sub(/^\*/,"").intern + raise ArgumentError, "Illegal template -- duplicate item #{it} in #{str.inspect}" if seen.key? it + seen[it] = true end seen end |