mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
Fix: Use derivation function for template fields
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7b921e1b3e
commit
df9fe579ea
1 changed files with 2 additions and 5 deletions
|
@ -31,12 +31,9 @@ func formatMessage(tplString string, m *irc.Message, r *plugins.Rule, fields plu
|
||||||
|
|
||||||
if m != nil {
|
if m != nil {
|
||||||
compiledFields["msg"] = m
|
compiledFields["msg"] = m
|
||||||
compiledFields["username"] = m.User
|
|
||||||
|
|
||||||
if len(m.Params) > 0 {
|
|
||||||
compiledFields["channel"] = m.Params[0]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
compiledFields["username"] = plugins.DeriveUser(m, fields)
|
||||||
|
compiledFields["channel"] = plugins.DeriveChannel(m, fields)
|
||||||
|
|
||||||
// Parse and execute template
|
// Parse and execute template
|
||||||
tpl, err := template.
|
tpl, err := template.
|
||||||
|
|
Loading…
Reference in a new issue