Add traces for automessage disable

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-05-25 18:40:06 +02:00
parent 14dbc832d7
commit ece2964c9a
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -74,6 +74,9 @@ func (a *autoMessage) CanSend() bool {
}
if !a.allowExecuteDisableOnTemplate() {
log.Trace("Auto-Message disabled by template")
// Reset the timer for this execution not to spam every second
a.lastMessageSent = time.Now()
return false
}
@ -154,6 +157,7 @@ func (a *autoMessage) allowExecuteDisableOnTemplate() bool {
"channel": a.Channel,
})
if err != nil {
log.WithError(err).Error("Error in auto-message disable template")
// Caused an error, forbid execution
return false
}