end
meta = ""
metadata = []
- if fact[:who]
- metadata << _("from %{who}" % fact.to_hash)
+ if @hash[:who]
+ metadata << _("from %{who}" % @hash)
end
- if fact[:when]
- metadata << _("on %{when}" % fact.to_hash)
+ if @hash[:when]
+ metadata << _("on %{when}" % @hash)
end
- if fact[:where]
- metadata << _("in %{where}" % fact.to_hash)
+ if @hash[:where]
+ metadata << _("in %{where}" % @hash)
end
unless metadata.empty?
- meta << _(" [learnt %{data}]" % {:data => metadata.join(" ")})
+ meta << _(" [%{data}]" % {:data => metadata.join(" ")})
end
return fact+meta
end
: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