From 5d44822a27b0c2cd0a3b60eb960c24e4366725d0 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 6 May 2021 15:19:24 +0200 Subject: [PATCH] Support templating in automessages Signed-off-by: Knut Ahlers --- automessage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/automessage.go b/automessage.go index 404ca30..3574e18 100644 --- a/automessage.go +++ b/automessage.go @@ -113,7 +113,11 @@ func (a *autoMessage) Send(c *irc.Client) error { a.lock.Lock() defer a.lock.Unlock() - msg := a.Message + msg, err := formatMessage(a.Message, nil, nil, nil) + if err != nil { + return errors.Wrap(err, "preparing message") + } + if a.UseAction { msg = fmt.Sprintf("\001ACTION %s\001", msg) }