mirror of https://github.com/velour/catbase.git
testing new remember with fallback
This commit is contained in:
parent
7cba01dd20
commit
522a1f1c35
|
@ -158,6 +158,11 @@ func (p *FactoidPlugin) trigger(message bot.Message) bool {
|
||||||
p.sayFact(message, *fact)
|
p.sayFact(message, *fact)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
r := strings.NewReplacer(",", "", "\"", "", ",", "", ".", "", ":", "")
|
||||||
|
if ok, fact := p.findTrigger(r.Replace(message.Body)); ok {
|
||||||
|
p.sayFact(message, *fact)
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -74,7 +74,6 @@ func (p *RememberPlugin) Message(message bot.Message) bool {
|
||||||
|
|
||||||
trigger := fmt.Sprintf("%s quotes", entry.User.Name)
|
trigger := fmt.Sprintf("%s quotes", entry.User.Name)
|
||||||
|
|
||||||
|
|
||||||
var funcres bson.M
|
var funcres bson.M
|
||||||
err := p.Bot.Db.Run(bson.M{"eval": "return counter(\"factoid\");"}, &funcres)
|
err := p.Bot.Db.Run(bson.M{"eval": "return counter(\"factoid\");"}, &funcres)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue