mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
[msgformatter] Fix: Trim leading / trailing spaces
in order to support templating resulting in `/me` message Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
847e119e5d
commit
9e2628c6e3
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"bytes"
|
||||
"regexp"
|
||||
"strings"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
|
@ -57,7 +58,7 @@ func formatMessage(tplString string, m *irc.Message, r *plugins.Rule, fields *pl
|
|||
buf := new(bytes.Buffer)
|
||||
err = tpl.Execute(buf, compiledFields.Data())
|
||||
|
||||
return buf.String(), errors.Wrap(err, "execute template")
|
||||
return strings.TrimSpace(buf.String()), errors.Wrap(err, "execute template")
|
||||
}
|
||||
|
||||
func formatMessageFieldChannel(compiledFields *plugins.FieldCollection, m *irc.Message, fields *plugins.FieldCollection) {
|
||||
|
|
Loading…
Reference in a new issue