mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
Fix: Do not copy reference but map content
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c18f96f889
commit
df9a23fec8
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,10 @@ import (
|
||||||
|
|
||||||
func formatMessage(tplString string, m *irc.Message, r *rule, fields map[string]interface{}) (string, error) {
|
func formatMessage(tplString string, m *irc.Message, r *rule, fields map[string]interface{}) (string, error) {
|
||||||
// Create anonymous functions in current context in order to access function variables
|
// Create anonymous functions in current context in order to access function variables
|
||||||
messageFunctions := korvike.GetFunctionMap()
|
messageFunctions := make(template.FuncMap)
|
||||||
|
for n, f := range korvike.GetFunctionMap() {
|
||||||
|
messageFunctions[n] = f
|
||||||
|
}
|
||||||
|
|
||||||
// Generic functions
|
// Generic functions
|
||||||
messageFunctions["toLower"] = strings.ToLower
|
messageFunctions["toLower"] = strings.ToLower
|
||||||
|
|
Loading…
Reference in a new issue