mirror of https://github.com/velour/catbase.git
fact: log some errs
This commit is contained in:
parent
3bedaf2ec0
commit
12543c569c
|
@ -50,6 +50,9 @@ func findAlias(db *sqlx.DB, fact string) (bool, *Factoid) {
|
|||
return false, nil
|
||||
}
|
||||
f, err := a.resolve(db)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("findAlias")
|
||||
}
|
||||
return err == nil, f
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,7 @@ func (p *FactoidPlugin) findTrigger(fact string) (bool, *Factoid) {
|
|||
|
||||
f, err := GetSingleFact(p.db, fact)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("GetSingleFact")
|
||||
return findAlias(p.db, fact)
|
||||
}
|
||||
return true, f
|
||||
|
@ -465,7 +466,6 @@ func (p *FactoidPlugin) register() {
|
|||
|
||||
log.Debug().Msgf("Message: %+v", r)
|
||||
|
||||
// This plugin has no business with normal messages
|
||||
if !message.Command {
|
||||
// look for any triggers in the db matching this message
|
||||
return p.trigger(c, message)
|
||||
|
|
Loading…
Reference in New Issue