Allow templating in respond_fallback

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-01-21 01:13:09 +01:00
parent ae4ad1a4bb
commit 406c748c8a
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
2 changed files with 4 additions and 2 deletions

View file

@ -16,7 +16,9 @@ func init() {
if r.RespondFallback == nil { if r.RespondFallback == nil {
return errors.Wrap(err, "preparing response") return errors.Wrap(err, "preparing response")
} }
msg = *r.RespondFallback if msg, err = formatMessage(*r.RespondFallback, m, ruleDef, nil); err != nil {
return errors.Wrap(err, "preparing response fallback")
}
} }
return errors.Wrap( return errors.Wrap(

View file

@ -32,7 +32,7 @@ rules: # See below for examples
# Send responding message to the channel the original message was received in # Send responding message to the channel the original message was received in
- respond: 'Hello chatter' # String, applies templating - respond: 'Hello chatter' # String, applies templating
respond_fallback: 'Oh noes' # String, text to send if the template function causes respond_fallback: 'Oh noes' # String, text to send if the template function causes
# an error, does NOT support templating (default: unset) # an error, applies templating (default: unset)
# Issue a timeout on the user who wrote the chat-line # Issue a timeout on the user who wrote the chat-line
- timeout: 1s # Duration value: 1s / 1m / 1h - timeout: 1s # Duration value: 1s / 1m / 1h